pub trait Listener {
type Connection: Debug;
type Address: Debug;
// Required method
fn poll_accept(
self: Pin<&mut Self>,
context: &mut Context<'_>
) -> Poll<Result<(Self::Connection, Self::Address)>>;
// Provided method
fn accept(&mut self) -> Accept<'_, Self> ⓘ
where Self: Unpin { ... }
}
Expand description
Trait for listeners that can accept new connections.
Required Associated Types§
sourcetype Connection: Debug
type Connection: Debug
The type of the connections return by the Self::accept()
function.
sourcetype Address: Debug
type Address: Debug
The type of the address returned by the Self::accept()
function.
Required Methods§
sourcefn poll_accept(
self: Pin<&mut Self>,
context: &mut Context<'_>
) -> Poll<Result<(Self::Connection, Self::Address)>>
fn poll_accept( self: Pin<&mut Self>, context: &mut Context<'_> ) -> Poll<Result<(Self::Connection, Self::Address)>>
Try to accept a new connection without blocking.
If no new connection is available, the current task is scheduled to wake up when a new connection is ready.
Provided Methods§
Object Safety§
This trait is not object safe.