pub trait ConnectionHandler: Send + 'static {
type Action: Debug + Send + 'static;
type Event: Debug + Send + 'static;
// Required methods
fn handle_action(&mut self, action: Self::Action);
fn poll(
&mut self,
cx: &mut Context<'_>,
) -> Poll<ConnectionHandlerEvent<Self::Event>>;
// Provided methods
fn connection_keep_alive(&self) -> bool { ... }
fn poll_close(&mut self, _: &mut Context<'_>) -> Poll<Option<Self::Event>> { ... }
fn select<H>(self, other: H) -> ConnectionHandlerSelect<Self, H>
where H: ConnectionHandler,
Self: Sized { ... }
fn map_event<O, F>(self, map: F) -> MapEvent<Self, F>
where Self: Sized,
O: Debug + Send + 'static,
F: FnMut(Self::Event) -> O + Send + 'static { ... }
fn map_action<O, F>(self, map: F) -> MapAction<Self, O, F>
where Self: Sized,
O: Debug + Send + 'static,
F: FnMut(O) -> Option<Self::Action> + Send + 'static { ... }
}Required Associated Types§
Required Methods§
fn handle_action(&mut self, action: Self::Action)
fn poll( &mut self, cx: &mut Context<'_>, ) -> Poll<ConnectionHandlerEvent<Self::Event>>
Provided Methods§
fn connection_keep_alive(&self) -> bool
fn poll_close(&mut self, _: &mut Context<'_>) -> Poll<Option<Self::Event>>
fn select<H>(self, other: H) -> ConnectionHandlerSelect<Self, H>where
H: ConnectionHandler,
Self: Sized,
fn map_event<O, F>(self, map: F) -> MapEvent<Self, F>
fn map_action<O, F>(self, map: F) -> MapAction<Self, O, F>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".