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