Skip to main content

AsyncFdReadyGuard

Struct AsyncFdReadyGuard 

Source
pub struct AsyncFdReadyGuard<'a, T: AsFd> { /* private fields */ }
Expand description

What a readiness wait of an AsyncFd found: the readiness, and the edge counts it is of, to clear with.

Implementations§

Source§

impl<T: AsFd> AsyncFdReadyGuard<'_, T>

Source

pub fn ready(&self) -> Ready

What may be ready.

Source

pub fn clear_ready(&mut self)

The descriptor would block: the next wait lasts until the driver says it may be ready again.

Source

pub fn clear_ready_matching(&mut self, ready: Ready)

Clears what of ready this guard holds.

Source

pub fn retain_ready(&mut self)

Keeps the readiness: the next wait may answer at once.

Source

pub fn get_inner(&self) -> &T

The descriptor.

Source§

impl<'a, T: AsFd> AsyncFdReadyGuard<'a, T>

Source

pub fn try_io<R>( &mut self, f: impl FnOnce(&'a AsyncFd<T>) -> Result<R>, ) -> Result<Result<R>, TryIoError>

Runs f; if it answers WouldBlock, the readiness is cleared and Err(TryIoError) comes back, else Ok with what it answered.

§Errors

TryIoError when f would block.

Source

pub fn get_ref(&self) -> &'a AsyncFd<T>

The descriptor’s AsyncFd.

Trait Implementations§

Source§

impl<T: AsFd> Debug for AsyncFdReadyGuard<'_, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, T> !RefUnwindSafe for AsyncFdReadyGuard<'a, T>

§

impl<'a, T> !UnwindSafe for AsyncFdReadyGuard<'a, T>

§

impl<'a, T> Freeze for AsyncFdReadyGuard<'a, T>

§

impl<'a, T> Send for AsyncFdReadyGuard<'a, T>
where T: Sync,

§

impl<'a, T> Sync for AsyncFdReadyGuard<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for AsyncFdReadyGuard<'a, T>

§

impl<'a, T> UnsafeUnpin for AsyncFdReadyGuard<'a, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.