Struct openvet_common::storage::ServeStorage
source · pub struct ServeStorage<S> { /* private fields */ }Expand description
A serving function to use with [::tarpc::server::InFlightRequest::execute].
Trait Implementations§
source§impl<S: Clone> Clone for ServeStorage<S>
impl<S: Clone> Clone for ServeStorage<S>
source§fn clone(&self) -> ServeStorage<S>
fn clone(&self) -> ServeStorage<S>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<S> Serve for ServeStorage<S>where
S: Storage,
impl<S> Serve for ServeStorage<S>where
S: Storage,
§type Req = StorageRequest
type Req = StorageRequest
Type of request.
§type Resp = StorageResponse
type Resp = StorageResponse
Type of response.
source§fn method(&self, req: &StorageRequest) -> Option<&'static str>
fn method(&self, req: &StorageRequest) -> Option<&'static str>
Extracts a method name from the request.
source§async fn serve(
self,
ctx: Context,
req: StorageRequest,
) -> Result<StorageResponse, ServerError>
async fn serve( self, ctx: Context, req: StorageRequest, ) -> Result<StorageResponse, ServerError>
Responds to a single request.
§fn before<Hook>(self, hook: Hook) -> BeforeRequestHook<Self, Hook>where
Hook: BeforeRequest<Self::Req>,
Self: Sized,
fn before<Hook>(self, hook: Hook) -> BeforeRequestHook<Self, Hook>where
Hook: BeforeRequest<Self::Req>,
Self: Sized,
Runs a hook before execution of the request. Read more
§fn after<Hook>(self, hook: Hook) -> AfterRequestHook<Self, Hook>where
Hook: AfterRequest<Self::Resp>,
Self: Sized,
fn after<Hook>(self, hook: Hook) -> AfterRequestHook<Self, Hook>where
Hook: AfterRequest<Self::Resp>,
Self: Sized,
Runs a hook after completion of a request. Read more
§fn before_and_after<Hook>(
self,
hook: Hook,
) -> BeforeAndAfterRequestHook<Self::Req, Self::Resp, Self, Hook>where
Hook: BeforeRequest<Self::Req> + AfterRequest<Self::Resp>,
Self: Sized,
fn before_and_after<Hook>(
self,
hook: Hook,
) -> BeforeAndAfterRequestHook<Self::Req, Self::Resp, Self, Hook>where
Hook: BeforeRequest<Self::Req> + AfterRequest<Self::Resp>,
Self: Sized,
Runs a hook before and after execution of the request. Read more
Auto Trait Implementations§
impl<S> Freeze for ServeStorage<S>where
S: Freeze,
impl<S> RefUnwindSafe for ServeStorage<S>where
S: RefUnwindSafe,
impl<S> Send for ServeStorage<S>where
S: Send,
impl<S> Sync for ServeStorage<S>where
S: Sync,
impl<S> Unpin for ServeStorage<S>where
S: Unpin,
impl<S> UnwindSafe for ServeStorage<S>where
S: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)