Trait toku_connection::handler::Handler [−][src]
pub trait Handler: Send + Sync + 'static { type InternalEvent: Send; const SEND_GO_AWAY: bool; fn max_payload_size(&self) -> ByteSize; fn upgrade(
&self,
tcp_stream: TcpStream
) -> Pin<Box<dyn Future<Output = Result<TcpStream, Error>> + Send>>; fn handshake(
&mut self,
reader_writer: ReaderWriter
) -> Pin<Box<dyn Future<Output = Result<(Ready, ReaderWriter), (Error, Option<ReaderWriter>)>> + Send>>; fn handle_frame(
&mut self,
frame: DelegatedFrame,
encoding: &'static str
) -> Option<Pin<Box<dyn Future<Output = Result<Response, (Error, u32)>> + Send>>>; fn handle_internal_event(
&mut self,
event: Self::InternalEvent,
id_sequence: &mut IdSequence
) -> Option<TokuFrame>; fn on_ping_received(&mut self); }
Expand description
A trait that handles the specific functionality of a connection. The client and server each implement this.
Associated Types
type InternalEvent: Send
type InternalEvent: Send
Events specific to the implementing connection handler. They will be passed through to the handle_internal_event callback.
Associated Constants
const SEND_GO_AWAY: bool
Required methods
fn max_payload_size(&self) -> ByteSize
fn max_payload_size(&self) -> ByteSize
The maximum payload size this connection can handle.
Takes a tcp stream and completes an HTTP upgrade.
Hello/HelloAck handshake.
Handle a single delegated frame. Optionally returns a future that resolves to a Response. The Response will be sent back through the socket to the other side.
fn handle_internal_event(
&mut self,
event: Self::InternalEvent,
id_sequence: &mut IdSequence
) -> Option<TokuFrame>
fn handle_internal_event(
&mut self,
event: Self::InternalEvent,
id_sequence: &mut IdSequence
) -> Option<TokuFrame>
Handle internal events for this connection. Completely opaque to the connection. Optionally
return a TokuFrame
that will be sent back through the socket to the other side.
fn on_ping_received(&mut self)
fn on_ping_received(&mut self)
Periodic callback that fires whenever a ping fires.