TxHandler

Trait TxHandler 

Source
pub trait TxHandler: TxBaseHandler {
    // Provided methods
    fn preflight_gather_outgoing(
        &self,
        peer_url: Url,
    ) -> BoxFut<'_, K2Result<Bytes>> { ... }
    fn preflight_validate_incoming(
        &self,
        peer_url: Url,
        data: Bytes,
    ) -> BoxFut<'_, K2Result<()>> { ... }
}
Expand description

Handler for whole transport-level events.

Provided Methods§

Source

fn preflight_gather_outgoing( &self, peer_url: Url, ) -> BoxFut<'_, K2Result<Bytes>>

Gather preflight data to send to a new opening connection. Returning an Err result will close this connection.

The default implementation sends an empty preflight message.

Source

fn preflight_validate_incoming( &self, peer_url: Url, data: Bytes, ) -> BoxFut<'_, K2Result<()>>

Validate preflight data sent by a remote peer on a new connection. Returning an Err result will close this connection.

The default implementation ignores the preflight data, and considers it valid.

Implementors§