Trait SessionSocketExt

Source
pub trait SessionSocketExt:
    AsyncRead
    + AsyncWrite
    + Send
    + Unpin {
    // Provided methods
    fn reliable_session<const MTU: usize>(
        self,
        ack: AcknowledgementState<MTU>,
        cfg: SessionSocketConfig,
    ) -> Result<ReliableSocket<MTU>>
       where Self: Sized + 'static { ... }
    fn unreliable_session<const MTU: usize>(
        self,
        id: &str,
        cfg: SessionSocketConfig,
    ) -> Result<UnreliableSocket<MTU>>
       where Self: Sized + 'static { ... }
}
Expand description

Adaptors for [futures::io::AsyncRead] + [futures::io::AsyncWrite] transport to use Session protocol.

Use compat first when the underlying transport is Tokio-based.

Provided Methods§

Source

fn reliable_session<const MTU: usize>( self, ack: AcknowledgementState<MTU>, cfg: SessionSocketConfig, ) -> Result<ReliableSocket<MTU>>
where Self: Sized + 'static,

Runs a reliable Session protocol on self.

Source

fn unreliable_session<const MTU: usize>( self, id: &str, cfg: SessionSocketConfig, ) -> Result<UnreliableSocket<MTU>>
where Self: Sized + 'static,

Runs unreliable Session protocol on self.

Implementors§

Source§

impl<T> SessionSocketExt for T
where T: AsyncRead + AsyncWrite + Send + Unpin + ?Sized,