Trait perspective_server::SessionHandler
source · pub trait SessionHandler: Send + Sync {
// Required method
fn send_response<'a>(
&'a mut self,
msg: &'a [u8],
) -> impl Future<Output = Result<(), ServerError>> + Send + 'a;
}Expand description
Use SessionHandler to implement a callback for messages emitted from
a Session, to be passed to the Server::new_session constructor.
Alternatively, a Session can be created from a closure instead via
Server::new_session_with_callback.
:
Client : Session
┏━━━━━━━━━━━━━━━━━━┓ : ┏━━━━━━━━━━━━━━━━━━━┓
┃ handle_response ┃<━━━┃ send_response (*) ┃
┃ .. ┃ : ┃ .. ┃
┗━━━━━━━━━━━━━━━━━━┛ : ┗━━━━━━━━━━━━━━━━━━━┛
:
Required Methods§
sourcefn send_response<'a>(
&'a mut self,
msg: &'a [u8],
) -> impl Future<Output = Result<(), ServerError>> + Send + 'a
fn send_response<'a>( &'a mut self, msg: &'a [u8], ) -> impl Future<Output = Result<(), ServerError>> + Send + 'a
Object Safety§
This trait is not object safe.