[−][src]Trait spirit_tokio::net::Accept
Abstraction over endpoints that accept connections.
Associated Types
type Connection: Send + Sync + 'static
The type of the accepted connection.
Required methods
fn poll_accept(
&mut self,
ctx: &mut Context<'_>
) -> Poll<Result<Self::Connection, IoError>>
&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.
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>;
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.
Implementations on Foreign Types
impl Accept for UnixListener
[src]
type Connection = UnixStream
fn poll_accept(
&mut self,
ctx: &mut Context<'_>
) -> Poll<Result<Self::Connection, IoError>>
[src]
&mut self,
ctx: &mut Context<'_>
) -> Poll<Result<Self::Connection, IoError>>
impl Accept for TcpListener
[src]
type Connection = TcpStream
fn poll_accept(
&mut self,
ctx: &mut Context<'_>
) -> Poll<Result<TcpStream, IoError>>
[src]
&mut self,
ctx: &mut Context<'_>
) -> Poll<Result<TcpStream, IoError>>
Implementors
impl<A, B> Accept for Either<A, B> where
A: Accept,
B: Accept,
[src]
A: Accept,
B: Accept,
type Connection = Either<A::Connection, B::Connection>
fn poll_accept(
&mut self,
ctx: &mut Context<'_>
) -> Poll<Result<Self::Connection, IoError>>
[src]
&mut self,
ctx: &mut Context<'_>
) -> Poll<Result<Self::Connection, IoError>>
impl<A, C> Accept for ConfiguredListener<A, C> where
A: Accept,
C: StreamConfig<A::Connection> + Send + Sync + 'static,
[src]
A: Accept,
C: StreamConfig<A::Connection> + Send + Sync + 'static,
type Connection = A::Connection
fn poll_accept(
&mut self,
ctx: &mut Context<'_>
) -> Poll<Result<A::Connection, IoError>>
[src]
&mut self,
ctx: &mut Context<'_>
) -> Poll<Result<A::Connection, IoError>>
impl<A: Accept> Accept for Limited<A>
[src]
type Connection = Tracked<A::Connection>
fn poll_accept(
&mut self,
ctx: &mut Context<'_>
) -> Poll<Result<Self::Connection, IoError>>
[src]
&mut self,
ctx: &mut Context<'_>
) -> Poll<Result<Self::Connection, IoError>>