Struct nix::sys::eventfd::EventFd

source ·
#[repr(transparent)]
pub struct EventFd(OwnedFd);

Tuple Fields§

§0: OwnedFd

Implementations§

source§

impl EventFd

source

pub fn new() -> Result<Self>

EventFd::from_value_and_flags with init_val = 0 and flags = EfdFlags::empty().

source

pub fn from_value_and_flags(init_val: u32, flags: EfdFlags) -> Result<Self>

Constructs EventFd with the given init_val and flags.

Wrapper around libc::eventfd.

source

pub fn from_flags(flags: EfdFlags) -> Result<Self>

EventFd::from_value_and_flags with init_val = 0 and given flags.

source

pub fn from_value(init_val: u32) -> Result<Self>

EventFd::from_value_and_flags with given init_val and flags = EfdFlags::empty().

source

pub fn arm(&self) -> Result<usize>

Arms self, a following call to poll, select or epoll will return immediately.

EventFd::write with 1.

source

pub fn defuse(&self) -> Result<usize>

Defuses self, a following call to poll, select or epoll will block.

EventFd::write with 0.

source

pub fn write(&self, value: u64) -> Result<usize>

Enqueues value triggers.

The next value calls to poll, select or epoll will return immediately.

EventFd::write with value.

source

pub fn read(&self) -> Result<u64>

Trait Implementations§

source§

impl AsFd for EventFd

source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
source§

impl AsRawFd for EventFd

source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
source§

impl Debug for EventFd

source§

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

Formats the value using the given formatter. Read more
source§

impl From<EventFd> for OwnedFd

source§

fn from(x: EventFd) -> OwnedFd

Converts to this type from the input type.

Auto Trait Implementations§

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>,

§

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>,

§

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.