Struct SigSet
#[repr(transparent)]
pub struct SigSet { /* private fields */ }
Specifies a set of Signals that may be blocked, waited for, etc.
Implementations
impl SigSet
fn all() -> SigSetInitialize to include all signals.
fn empty() -> SigSetInitialize to include nothing.
fn add(&mut self, signal: Signal)Add the specified signal to the set.
fn clear(&mut self)Remove all signals from this set.
fn remove(&mut self, signal: Signal)Remove the specified signal from this set.
fn contains(&self, signal: Signal) -> boolReturn whether this set includes the specified signal.
fn iter(&self) -> SigSetIter<'_>Returns an iterator that yields the signals contained in this set.
fn thread_get_mask() -> Result<SigSet>Gets the currently blocked (masked) set of signals for the calling thread.
fn thread_set_mask(&self) -> Result<()>Sets the set of signals as the signal mask for the calling thread.
fn thread_block(&self) -> Result<()>Adds the set of signals to the signal mask for the calling thread.
fn thread_unblock(&self) -> Result<()>Removes the set of signals from the signal mask for the calling thread.
fn thread_swap_mask(&self, how: SigmaskHow) -> Result<SigSet>Sets the set of signals as the signal mask, and returns the old mask.
fn wait(&self) -> Result<Signal>Suspends execution of the calling thread until one of the signals in the signal mask becomes pending, and returns the accepted signal.
fn suspend(&self) -> Result<()>Wait for a signal
Return value
If
sigsuspend(2)is interrupted (EINTR), this function returnsOk. Ifsigsuspend(2)set other error, this function returnsErr.For more information see the
sigsuspend(2).unsafe fn from_sigset_t_unchecked(sigset: sigset_t) -> SigSetConverts a
libc::sigset_tobject to aSigSetwithout checking whether thelibc::sigset_tis already initialized.Safety
The
sigsetpassed in must be a valid an initializedlibc::sigset_tby calling eithersigemptyset(3)orsigfillset(3). Otherwise, the results are undefined.
Trait Implementations
impl AsRef<sigset_t> for SigSet
fn as_ref(&self) -> &sigset_t
impl BitOr for SigSet
type Output = SigSet;fn bitor(self, rhs: Self) -> Self::Output
impl BitOr<Signal> for SigSet
type Output = SigSet;fn bitor(self, rhs: Signal) -> Self::Output
impl Clone for SigSet
fn clone(&self) -> Self
impl Copy for SigSet
impl Debug for SigSet
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for SigSet
impl Extend<Signal> for SigSet
fn extend<T>(&mut self, iter: T) where T: IntoIterator<Item = Signal>,
impl From<Signal> for SigSet
fn from(signal: Signal) -> SigSet
impl FromIterator<Signal> for SigSet
fn from_iter<T>(iter: T) -> Self where T: IntoIterator<Item = Signal>,
impl Hash for SigSet
fn hash<H: Hasher>(&self, state: &mut H)
impl PartialEq for SigSet
fn eq(&self, other: &Self) -> bool