SigSet

Struct SigSet 

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

A wrapper for libc::sigset_t

Implementations§

Source§

impl SigSet

Source

pub fn new() -> Self

Create new, empty SigSet

Source

pub fn clear(&mut self) -> &mut Self

Clear all signals in SigSet

Source

pub fn fill(&mut self) -> &mut Self

Set all signals in SigSet

Source

pub fn add(&mut self, sig: Sig) -> &mut Self

Add a signle Sig to SigSet.

Re-adding already existing signal does nothing.

Source

pub fn add_many(&mut self, sigs: &[Sig]) -> &mut Self

Add a list of Sigs to SigSet.

Re-adding already existing signals does nothing.

Source

pub fn remove(&mut self, sig: Sig) -> &mut Self

Remove a signle Sig from SigSet.

Removing already removed signal does nothing.

Source

pub fn remove_many(&mut self, sigs: &[Sig]) -> &mut Self

Remove a list of Sigs from SigSet.

Removing already removed signals does nothing.

Source

pub fn has(&self, sig: Sig) -> bool

Check if Signal is present in SigSet

Source

pub fn has_any(&self, sigs: &[Sig]) -> bool

Check if SigSet has any of Signals from the list set

Source

pub fn has_all(&self, sigs: &[Sig]) -> bool

Check if SigSet has all of Signals from the list set

Source

pub fn disable_default_handler(&self) -> Result<()>

Detach SigSet from default handlers.

Specified signals are ignored by runtime but can be handled by user-defined handlers, for example by [mio-signalfd].

Source

pub fn enable_default_handler(&self) -> Result<()>

Attach a SigSet to default handlers.

Specified signals are handled by runtime according to default rules, which may prevent signal from reaching user-defined handler.

Source

pub fn from(sigs: &[Sig]) -> Self

Create SigSet pre-populated with list of Sigs

Source

pub fn as_ptr(&self) -> *const sigset_t

Expose as const pointer to underlying libc::sigset_t

Source

pub fn as_mut_ptr(&mut self) -> *mut sigset_t

Expose as mut pointer to underlying libc::sigset_t

Auto Trait Implementations§

§

impl Freeze for SigSet

§

impl RefUnwindSafe for SigSet

§

impl Send for SigSet

§

impl Sync for SigSet

§

impl Unpin for SigSet

§

impl UnwindSafe for SigSet

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.