[][src]Trait libp2prs_core::transport::TransportListener

pub trait TransportListener: Send {
    type Output: Send;
#[must_use]    pub fn accept<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<ListenerEvent<Self::Output>, TransportError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
pub fn multi_addr(&self) -> Option<&Multiaddr>; pub fn incoming(&mut self) -> Incoming<'_, Self>
    where
        Self: Sized
, { ... }
#[must_use] pub fn accept_output<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } }

Associated Types

type Output: Send[src]

The result of a connection setup process, including protocol upgrades.

Typically the output contains at least a handle to a data stream (i.e. a connection or a substream multiplexer on top of a connection) that provides APIs for sending and receiving data through the connection.

Loading content...

Required methods

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

The Listener handles the inbound connections

pub fn multi_addr(&self) -> Option<&Multiaddr>[src]

Returns the local addresses being listened on.

This might be None if it is listening on an unspecified address. The actual addresses will be reported by ListenerEvent::AddressAdded in this case.

Loading content...

Provided methods

pub fn incoming(&mut self) -> Incoming<'_, Self> where
    Self: Sized
[src]

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

The Listener handles the inbound connections

Loading content...

Implementors

impl TransportListener for DummyListener[src]

type Output = DummyStream

impl TransportListener for Listener[src]

type Output = Channel

impl<TOutput> TransportListener for ProtectorListener<TOutput> where
    TOutput: ConnectionInfo + SplittableReadWrite
[src]

type Output = PnetOutput<TOutput>

impl<TOutput, TMux, TSec> TransportListener for ListenerUpgrade<TOutput, TMux, TSec> where
    TOutput: ConnectionInfo + ReadEx + WriteEx + Unpin + 'static,
    TSec: Upgrader<TOutput> + Send + Clone + 'static,
    TSec::Output: SecureInfo + ReadEx + WriteEx + Unpin,
    TMux: Upgrader<TSec::Output> + 'static,
    TMux::Output: StreamMuxerEx + 'static, 
[src]

type Output = IStreamMuxer

impl<TOutput: Send> TransportListener for TimeoutListener<TOutput>[src]

type Output = TOutput

Loading content...