Trait libp2prs_core::muxing::StreamMuxer[][src]

pub trait StreamMuxer {
    #[must_use]
    fn open_stream<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<IReadWrite, TransportError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn accept_stream<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<IReadWrite, TransportError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn close<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn task(&mut self) -> Option<BoxFuture<'static, ()>>;
fn box_clone(&self) -> IStreamMuxer; }

Required methods

#[must_use]
fn open_stream<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<IReadWrite, TransportError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Opens a new outgoing substream.

#[must_use]
fn accept_stream<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<IReadWrite, TransportError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Accepts a new incoming substream.

#[must_use]
fn close<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Closes the stream muxer, the runtime of stream muxer will then exit.

fn task(&mut self) -> Option<BoxFuture<'static, ()>>[src]

Returns a Future which represents the main loop of the stream muxer.

fn box_clone(&self) -> IStreamMuxer[src]

Returns the cloned Trait object.

Loading content...

Implementors

impl<A, B> StreamMuxer for EitherOutput<A, B> where
    A: StreamMuxer + Send,
    B: StreamMuxer + Send
[src]

Loading content...