Struct SignalFd

Source
pub struct SignalFd(/* private fields */);
Expand description

Special file descriptor from which Signals directed to the caller can be read

Note that a signal fd must not derive neither Clone nor Copy!

Implementations§

Source§

impl SignalFd

Source

pub fn new(signals: SignalSet) -> Result<SignalFd>

Return a SignalFd that will be able to read the signals given in the signal set signals.

Source

pub fn read_signal(&mut self) -> Result<Signal>

Read and return a Signal

Note this function will block until a signal could be read.

Trait Implementations§

Source§

impl Debug for SignalFd

Source§

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

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

impl Drop for SignalFd

Source§

fn drop(&mut self)

Drop the SignalFd

Dropping a signal fd involves calling libc::close(). Note that close is special in the sense that all errors except an invalid signal fd should simply be ignored.

Source§

impl PartialEq for SignalFd

Source§

fn eq(&self, other: &SignalFd) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Source for SignalFd

Source§

fn register( &mut self, registry: &Registry, token: Token, interests: Interest, ) -> Result<()>

Register self with the given Registry instance. Read more
Source§

fn reregister( &mut self, registry: &Registry, token: Token, interests: Interest, ) -> Result<()>

Re-register self with the given Registry instance. Read more
Source§

fn deregister(&mut self, registry: &Registry) -> Result<()>

Deregister self from the given Registry instance. Read more
Source§

impl Eq for SignalFd

Source§

impl StructuralPartialEq for SignalFd

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

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.