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
Auto Trait Implementations
impl Freeze for SigSet
impl RefUnwindSafe for SigSet
impl Send for SigSet
impl Sync for SigSet
impl Unpin for SigSet
impl UnsafeUnpin for SigSet
impl UnwindSafe for SigSet
Blanket Implementations
impl<T> Any for SigSet
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for SigSet
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for SigSet
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for SigSet
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for SigSet
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for SigSet
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for SigSet
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for SigSet
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for SigSet
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>