pub struct Acceptor { /* private fields */ }
Implementations
sourceimpl Acceptor
impl Acceptor
sourcepub fn poll_accept(
&mut self,
context: &mut Context<'_>
) -> Poll<Option<Connection>>
pub fn poll_accept(
&mut self,
context: &mut Context<'_>
) -> Poll<Option<Connection>>
Polls for incoming connections and returns them.
The method will return
Poll::Ready(Some(connection))
if a connection was accepted.Poll::Ready(None)
if the acceptor is closed.Poll::Pending
if no new connection was accepted yet. In this case the caller must retry polling as soon as a client establishes a connection. In order to notify the application of this condition, the method will save thecore::task::Waker
which is provided as part of theContext
parameter, and notify it as soon as retrying the method will yield a different result.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Acceptor
impl Send for Acceptor
impl Sync for Acceptor
impl Unpin for Acceptor
impl !UnwindSafe for Acceptor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more