Trait noxious::socket::SocketListener[][src]

pub trait SocketListener: Sized + Send + Sync {
    type Stream: SocketStream + 'static;
#[must_use]    fn bind<'life0, 'async_trait>(
        addr: &'life0 str
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
    where
        Self: Sized,
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn accept<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(Self::Stream, SocketAddr)>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

The TcpListener interface we need to mock

Associated Types

type Stream: SocketStream + 'static[src]

The associated listener interface to be mocked too

Loading content...

Required methods

#[must_use]fn bind<'life0, 'async_trait>(
    addr: &'life0 str
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>> where
    Self: Sized,
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Creates a new SocketListener, which will be bound to the specified address.

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

Accepts a new incoming connection from this listener.

Loading content...

Implementors

impl SocketListener for TcpListener[src]

type Stream = TcpStream

Loading content...