Skip to main content

ClientProtocol

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>,
    ) { ... }
}

Required Associated Types§

Required Methods§

Source

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§

Source

fn on_connect( &mut self, conn_id: SlotId, conn_state: &mut Self::ConnState, out: Egress<'_, Self::CodecLayer>, )

Source

fn wants_close(&self, conn_state: &Self::ConnState) -> bool

Source

fn on_disconnect( &mut self, conn_id: SlotId, conn_state: &mut Self::ConnState, out: Egress<'_, Self::CodecLayer>, )

Implementors§