pub struct PollFd<T: AsRawFd>(/* private fields */);
Expand description
A wrapper for socket, providing functionalities to wait for readiness.
Implementations§
source§impl<T: AsRawFd + 'static> PollFd<T>
impl<T: AsRawFd + 'static> PollFd<T>
sourcepub async fn accept_ready(&self) -> Result<()>
pub async fn accept_ready(&self) -> Result<()>
Wait for accept readiness, before calling accept
, or after accept
returns WouldBlock
.
sourcepub async fn connect_ready(&self) -> Result<()>
pub async fn connect_ready(&self) -> Result<()>
Wait for connect readiness.
sourcepub async fn read_ready(&self) -> Result<()>
pub async fn read_ready(&self) -> Result<()>
Wait for read readiness.
sourcepub async fn write_ready(&self) -> Result<()>
pub async fn write_ready(&self) -> Result<()>
Wait for write readiness.
Trait Implementations§
source§impl<T: AsRawFd + AsRawSocket> AsRawSocket for PollFd<T>
Available on Windows only.
impl<T: AsRawFd + AsRawSocket> AsRawSocket for PollFd<T>
Available on Windows only.
source§fn as_raw_socket(&self) -> RawSocket
fn as_raw_socket(&self) -> RawSocket
Extracts the raw socket. Read more
Return a cloned
SharedFd
.Auto Trait Implementations§
impl<T> !Freeze for PollFd<T>
impl<T> RefUnwindSafe for PollFd<T>
impl<T> Send for PollFd<T>
impl<T> Sync for PollFd<T>
impl<T> Unpin for PollFd<T>
impl<T> UnwindSafe for PollFd<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more