Skip to main content

ClientProtocol

Trait ClientProtocol 

Source
pub trait ClientProtocol: 'static {
    type Framer: ClientFramer + Default + 'static;
    type ConnState: Default + 'static;

    // Required method
    fn on_response(
        &mut self,
        conn_id: SlotId,
        conn_state: &mut Self::ConnState,
        head: <Self::Framer as ClientFramer>::Head,
        out: Egress<'_>,
    );

    // Provided methods
    fn on_connect(
        &mut self,
        conn_id: SlotId,
        conn_state: &mut Self::ConnState,
        out: Egress<'_>,
    ) { ... }
    fn wants_close(&self, conn_state: &Self::ConnState) -> bool { ... }
    fn on_disconnect(
        &mut self,
        conn_id: SlotId,
        conn_state: &mut Self::ConnState,
    ) { ... }
}

Required Associated Types§

Source

type Framer: ClientFramer + Default + 'static

Source

type ConnState: Default + 'static

Required Methods§

Source

fn on_response( &mut self, conn_id: SlotId, conn_state: &mut Self::ConnState, head: <Self::Framer as ClientFramer>::Head, out: Egress<'_>, )

Provided Methods§

Source

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

Source

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

Source

fn on_disconnect(&mut self, conn_id: SlotId, conn_state: &mut Self::ConnState)

Implementors§