Trait UidMux

Source
pub trait UidMux<Id> {
    type Stream: AsyncWrite + AsyncRead + Send + Sync + Unpin + 'static;
    type Error;

    // Required method
    fn open<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 Id,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Stream, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A multiplexer that opens streams with unique ids.

Required Associated Types§

Source

type Stream: AsyncWrite + AsyncRead + Send + Sync + Unpin + 'static

Stream type.

Source

type Error

Error type.

Required Methods§

Source

fn open<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 Id, ) -> Pin<Box<dyn Future<Output = Result<Self::Stream, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Open a new stream with the given id.

Implementors§

Source§

impl<Id> UidMux<Id> for YamuxCtrl
where Id: Debug + AsRef<[u8]> + Sync,