pub trait WebSocketContext:
Stream<Item = WebSocketStreamResult<Next<Self::Incoming, Self::Outgoing, Self::Responder>>>
+ WebSocketErrorResponder
+ Sized {
type Options: IntoWebSocketContext<Self>;
type Incoming: CommunicableType;
type Outgoing: CommunicableType + From<GenericWebSocketError>;
type Responder;
// Required methods
fn handle_incoming(
&mut self,
incoming: Communication<Self::Incoming>,
) -> impl Future<Output = Result<(), WebSocketError>> + Send;
fn handle_outgoing(
&mut self,
outgoing: WebSocketItem<Communication<Self::Outgoing>, Self::Responder>,
) -> impl Future<Output = Result<(), WebSocketError>> + Send;
// Provided method
fn with_options(
options: Self::Options,
channel: <Self::Options as IntoWebSocketContext<Self>>::Channel,
) -> Self { ... }
}Required Associated Types§
type Options: IntoWebSocketContext<Self>
type Incoming: CommunicableType
type Outgoing: CommunicableType + From<GenericWebSocketError>
type Responder
Required Methods§
fn handle_incoming( &mut self, incoming: Communication<Self::Incoming>, ) -> impl Future<Output = Result<(), WebSocketError>> + Send
fn handle_outgoing( &mut self, outgoing: WebSocketItem<Communication<Self::Outgoing>, Self::Responder>, ) -> impl Future<Output = Result<(), WebSocketError>> + Send
Provided Methods§
fn with_options( options: Self::Options, channel: <Self::Options as IntoWebSocketContext<Self>>::Channel, ) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.