pub trait ServerProtocol: 'static {
type Framer: Framer;
type ConnState: Default + 'static;
const SUPPORTS_PARK: bool = false;
// Required methods
fn framer(&mut self) -> &mut Self::Framer;
fn handle<'buf>(
&mut self,
req: &'buf [u8],
head: <Self::Framer as Framer>::Head<'buf>,
write: &mut [u8],
) -> HandlerAction;
// Provided methods
fn handle_park<'buf>(
&mut self,
conn_id: SlotId,
conn_state: &mut Self::ConnState,
req: &'buf [u8],
head: <Self::Framer as Framer>::Head<'buf>,
write: &mut [u8],
) -> ParkAction { ... }
fn oversize_response(&self) -> &'static [u8] ⓘ { ... }
fn route_request_body_kind(
&self,
head: &<Self::Framer as Framer>::Head<'_>,
) -> RouteRequestBodyKind { ... }
fn handle_request_stream<'buf>(
&mut self,
head_bytes: &'buf [u8],
head: <Self::Framer as Framer>::Head<'buf>,
body_stream: RequestBodyStream,
write: &mut [u8],
) -> RequestStreamAction { ... }
fn on_register(
&mut self,
conn_id: SlotId,
conn_state: &mut Self::ConnState,
) -> Option<Pin<Box<dyn Future<Output = ()> + 'static>>> { ... }
fn drain_outbound(
&mut self,
conn_state: &mut Self::ConnState,
write: &mut [u8],
) -> u32 { ... }
fn close_pending(&self, conn_state: &Self::ConnState) -> bool { ... }
}Provided Associated Constants§
const SUPPORTS_PARK: bool = false
Required Associated Types§
Required Methods§
fn framer(&mut self) -> &mut Self::Framer
fn handle<'buf>( &mut self, req: &'buf [u8], head: <Self::Framer as Framer>::Head<'buf>, write: &mut [u8], ) -> HandlerAction
Provided Methods§
fn handle_park<'buf>( &mut self, conn_id: SlotId, conn_state: &mut Self::ConnState, req: &'buf [u8], head: <Self::Framer as Framer>::Head<'buf>, write: &mut [u8], ) -> ParkAction
fn oversize_response(&self) -> &'static [u8] ⓘ
fn route_request_body_kind( &self, head: &<Self::Framer as Framer>::Head<'_>, ) -> RouteRequestBodyKind
fn handle_request_stream<'buf>( &mut self, head_bytes: &'buf [u8], head: <Self::Framer as Framer>::Head<'buf>, body_stream: RequestBodyStream, write: &mut [u8], ) -> RequestStreamAction
fn on_register( &mut self, conn_id: SlotId, conn_state: &mut Self::ConnState, ) -> Option<Pin<Box<dyn Future<Output = ()> + 'static>>>
fn drain_outbound( &mut self, conn_state: &mut Self::ConnState, write: &mut [u8], ) -> u32
fn close_pending(&self, conn_state: &Self::ConnState) -> bool
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.