Struct PollFd
pub struct PollFd<T>(/* private fields */)
where
T: AsFd;Available on crate feature
net only.Expand description
A wrapper for socket, providing functionalities to wait for readiness.
Implementations§
§impl<T> PollFd<T>where
T: AsFd + 'static,
impl<T> PollFd<T>where
T: AsFd + 'static,
pub async fn accept_ready(&self) -> Result<(), Error>
pub async fn accept_ready(&self) -> Result<(), Error>
Wait for accept readiness, before calling accept, or after accept
returns WouldBlock.
pub async fn connect_ready(&self) -> Result<(), Error>
pub async fn connect_ready(&self) -> Result<(), Error>
Wait for connect readiness.
pub async fn read_ready(&self) -> Result<(), Error>
pub async fn read_ready(&self) -> Result<(), Error>
Wait for read readiness.
pub async fn write_ready(&self) -> Result<(), Error>
pub async fn write_ready(&self) -> Result<(), Error>
Wait for write readiness.
Trait Implementations§
§impl<T> AsFd for PollFd<T>where
T: AsFd,
impl<T> AsFd for PollFd<T>where
T: AsFd,
§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. 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§
§impl<T> AsSource for Twhere
T: AsFd,
impl<T> AsSource for Twhere
T: AsFd,
§fn source(&self) -> BorrowedFd<'_>
fn source(&self) -> BorrowedFd<'_>
Returns the borrowed file descriptor.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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