Skip to main content

WakeFd

Struct WakeFd 

Source
pub struct WakeFd { /* private fields */ }
Expand description

A level-triggered wake descriptor: readable from the first ring until drain. A supervisor passes fd to wait_child_or; any thread rings it after changing what the supervisor must re-check.

Implementations§

Source§

impl WakeFd

Source

pub fn new() -> Result<Self>

Source

pub fn ring(&self)

Make the descriptor readable. Only a write(2): no allocation or lock, so a signal handler may call it. A full counter or pipe is already readable, so a failed write loses nothing.

Source

pub fn fd(&self) -> BorrowedFd<'_>

The descriptor to wait on; readable while rung and not drained.

Source

pub fn drain(&self)

Consume every ring so far, making the descriptor unreadable again. Drain before re-checking state, so a ring racing the check is kept.

Trait Implementations§

Source§

impl Debug for WakeFd

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for WakeFd

§

impl Freeze for WakeFd

§

impl Move for WakeFd

§

impl RefUnwindSafe for WakeFd

§

impl Send for WakeFd

§

impl Sync for WakeFd

§

impl Unpin for WakeFd

§

impl UnsafeUnpin for WakeFd

§

impl UnwindSafe for WakeFd

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.

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.