Trait ClientProtocol
Source pub trait ClientProtocol: 'static {
type Framer: ClientFramer + Default + 'static;
type ConnState: Default + 'static;
type CodecLayer: CodecLayer;
// Required method
fn on_response(
&mut self,
conn_id: SlotId,
conn_state: &mut Self::ConnState,
head: <Self::Framer as ClientFramer>::Head,
out: Egress<'_, Self::CodecLayer>,
);
// Provided methods
fn on_connect(
&mut self,
conn_id: SlotId,
conn_state: &mut Self::ConnState,
out: Egress<'_, Self::CodecLayer>,
) { ... }
fn wants_close(&self, conn_state: &Self::ConnState) -> bool { ... }
fn on_disconnect(
&mut self,
conn_id: SlotId,
conn_state: &mut Self::ConnState,
out: Egress<'_, Self::CodecLayer>,
) { ... }
}