[][src]Trait spirit_tokio::net::Accept

pub trait Accept: Send + Sync + 'static {
    type Connection: Send + Sync + 'static;
    fn poll_accept(
        &mut self,
        ctx: &mut Context<'_>
    ) -> Poll<Result<Self::Connection, IoError>>; fn accept(&mut self) -> AcceptFuture<'_, Self>

Notable traits for AcceptFuture<'_, A>

impl<A: Accept, '_> Future for AcceptFuture<'_, A> type Output = Result<A::Connection, IoError>;
{ ... } }

Abstraction over endpoints that accept connections.

Associated Types

type Connection: Send + Sync + 'static

The type of the accepted connection.

Loading content...

Required methods

fn poll_accept(
    &mut self,
    ctx: &mut Context<'_>
) -> Poll<Result<Self::Connection, IoError>>

Poll for availability of the next connection.

In case there's none ready, it returns Poll::Pending and the current task will be notified by a waker.

Loading content...

Provided methods

fn accept(&mut self) -> AcceptFuture<'_, Self>

Notable traits for AcceptFuture<'_, A>

impl<A: Accept, '_> Future for AcceptFuture<'_, A> type Output = Result<A::Connection, IoError>;

Accept the next connection.

Returns a future that will yield the next connection.

Loading content...

Implementations on Foreign Types

impl Accept for UnixListener[src]

type Connection = UnixStream

impl Accept for TcpListener[src]

type Connection = TcpStream

Loading content...

Implementors

impl<A, B> Accept for Either<A, B> where
    A: Accept,
    B: Accept
[src]

type Connection = Either<A::Connection, B::Connection>

impl<A, C> Accept for ConfiguredListener<A, C> where
    A: Accept,
    C: StreamConfig<A::Connection> + Send + Sync + 'static, 
[src]

type Connection = A::Connection

impl<A: Accept> Accept for Limited<A>[src]

type Connection = Tracked<A::Connection>

Loading content...