Struct distant_core::DistantApiServerHandler
source · pub struct DistantApiServerHandler<T>where
T: DistantApi,{ /* private fields */ }
Expand description
Represents a ServerHandler
that leverages an API compliant with distant
Implementations§
source§impl<T> DistantApiServerHandler<T>where
T: DistantApi,
impl<T> DistantApiServerHandler<T>where T: DistantApi,
Trait Implementations§
source§impl<T> ServerHandler for DistantApiServerHandler<T>where
T: DistantApi + Send + Sync + 'static,
impl<T> ServerHandler for DistantApiServerHandler<T>where T: DistantApi + Send + Sync + 'static,
source§fn on_connect<'life0, 'async_trait>(
&'life0 self,
id: ConnectionId
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_connect<'life0, 'async_trait>( &'life0 self, id: ConnectionId ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Overridden to leverage DistantApi
implementation of on_connect
.
source§fn on_disconnect<'life0, 'async_trait>(
&'life0 self,
id: ConnectionId
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_disconnect<'life0, 'async_trait>( &'life0 self, id: ConnectionId ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Overridden to leverage DistantApi
implementation of on_disconnect
.
source§fn on_request<'life0, 'async_trait>(
&'life0 self,
ctx: RequestCtx<Self::Request, Self::Response>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_request<'life0, 'async_trait>( &'life0 self, ctx: RequestCtx<Self::Request, Self::Response> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Invoked upon receiving a request from a client. The server should process this
request, which can be found in
ctx
, and send one or more replies in response.Auto Trait Implementations§
impl<T> RefUnwindSafe for DistantApiServerHandler<T>where T: RefUnwindSafe,
impl<T> Send for DistantApiServerHandler<T>where T: Send + Sync,
impl<T> Sync for DistantApiServerHandler<T>where T: Send + Sync,
impl<T> Unpin for DistantApiServerHandler<T>
impl<T> UnwindSafe for DistantApiServerHandler<T>where T: RefUnwindSafe,
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