pub struct SignalState {
pub handlers: BTreeMap<LinuxSignal, SignalAction>,
pub blocked: SignalMask,
pub pending: SignalMask,
}Expand description
Signal handler state for a task
Fields§
§handlers: BTreeMap<LinuxSignal, SignalAction>Signal handlers (signal number -> handler action)
blocked: SignalMaskBlocked signals mask
pending: SignalMaskPending signals that are blocked
Implementations§
Source§impl SignalState
impl SignalState
pub fn new() -> Self
Sourcepub fn set_handler(&mut self, signal: LinuxSignal, action: SignalAction)
pub fn set_handler(&mut self, signal: LinuxSignal, action: SignalAction)
Set signal handler
Sourcepub fn get_handler(&self, signal: LinuxSignal) -> SignalAction
pub fn get_handler(&self, signal: LinuxSignal) -> SignalAction
Get signal handler
Sourcepub fn add_pending(&mut self, signal: LinuxSignal)
pub fn add_pending(&mut self, signal: LinuxSignal)
Add pending signal
Sourcepub fn remove_pending(&mut self, signal: LinuxSignal)
pub fn remove_pending(&mut self, signal: LinuxSignal)
Remove pending signal
Sourcepub fn is_pending(&self, signal: LinuxSignal) -> bool
pub fn is_pending(&self, signal: LinuxSignal) -> bool
Check if signal is pending
Sourcepub fn next_deliverable_signal(&self) -> Option<LinuxSignal>
pub fn next_deliverable_signal(&self) -> Option<LinuxSignal>
Get next deliverable signal (not blocked and pending)
Trait Implementations§
Source§impl Clone for SignalState
impl Clone for SignalState
Source§fn clone(&self) -> SignalState
fn clone(&self) -> SignalState
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SignalState
impl Debug for SignalState
Auto Trait Implementations§
impl Freeze for SignalState
impl RefUnwindSafe for SignalState
impl Send for SignalState
impl Sync for SignalState
impl Unpin for SignalState
impl UnwindSafe for SignalState
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)