pub struct SigSet { /* private fields */ }Expand description
Specifies a set of Signals that may be blocked, waited for, etc.
Implementations§
Source§impl SigSet
impl SigSet
Sourcepub fn contains(&self, signal: Signal) -> bool
pub fn contains(&self, signal: Signal) -> bool
Return whether this set includes the specified signal.
Sourcepub fn iter(&self) -> SigSetIter<'_> ⓘ
pub fn iter(&self) -> SigSetIter<'_> ⓘ
Returns an iterator that yields the signals contained in this set.
Sourcepub fn thread_get_mask() -> Result<SigSet>
pub fn thread_get_mask() -> Result<SigSet>
Gets the currently blocked (masked) set of signals for the calling thread.
Sourcepub fn thread_set_mask(&self) -> Result<()>
pub fn thread_set_mask(&self) -> Result<()>
Sets the set of signals as the signal mask for the calling thread.
Sourcepub fn thread_block(&self) -> Result<()>
pub fn thread_block(&self) -> Result<()>
Adds the set of signals to the signal mask for the calling thread.
Sourcepub fn thread_unblock(&self) -> Result<()>
pub fn thread_unblock(&self) -> Result<()>
Removes the set of signals from the signal mask for the calling thread.
Sourcepub fn thread_swap_mask(&self, how: SigmaskHow) -> Result<SigSet>
pub fn thread_swap_mask(&self, how: SigmaskHow) -> Result<SigSet>
Sets the set of signals as the signal mask, and returns the old mask.
Sourcepub fn wait(&self) -> Result<Signal>
pub 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.
Sourcepub fn suspend(&self) -> Result<()>
pub fn suspend(&self) -> Result<()>
Wait for a signal
§Return value
If sigsuspend(2) is interrupted (EINTR), this function returns Ok.
If sigsuspend(2) set other error, this function returns Err.
For more information see the
sigsuspend(2).
Sourcepub unsafe fn from_sigset_t_unchecked(sigset: sigset_t) -> SigSet
pub unsafe fn from_sigset_t_unchecked(sigset: sigset_t) -> SigSet
Converts a libc::sigset_t object to a SigSet without checking whether the
libc::sigset_t is already initialized.
§Safety
The sigset passed in must be a valid an initialized libc::sigset_t by calling either
sigemptyset(3) or
sigfillset(3).
Otherwise, the results are undefined.
Trait Implementations§
Source§impl Extend<Signal> for SigSet
impl Extend<Signal> for SigSet
Source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Signal>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Signal>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)