wrpc_transport::frame

Trait ConnHandler

Source
pub trait ConnHandler<Rx, Tx> {
    // Provided methods
    fn on_ingress(rx: Rx, res: Result<()>) -> impl Future<Output = ()> + Send { ... }
    fn on_egress(tx: Tx, res: Result<()>) -> impl Future<Output = ()> + Send { ... }
}
Expand description

Connection handler defines the connection I/O behavior. It is mostly useful for transports that may require additional clean up not already covered by [AsyncWrite::shutdown], for example. This API is experimental and may change in backwards-incompatible ways in the future.

Provided Methods§

Source

fn on_ingress(rx: Rx, res: Result<()>) -> impl Future<Output = ()> + Send

Handle ingress completion

Source

fn on_egress(tx: Tx, res: Result<()>) -> impl Future<Output = ()> + Send

Handle egress completion

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.

Implementations on Foreign Types§

Source§

impl<Rx, Tx> ConnHandler<Rx, Tx> for ()

Implementors§