pub struct Handle { /* private fields */ }
Expand description
Implementations§
Source§impl Handle
impl Handle
Sourcepub fn add_signal(&self, signal: i32) -> Result<(), Error>
pub fn add_signal(&self, signal: i32) -> Result<(), Error>
Registers another signal to the set watched by the associated instance.
§Notes
- This is safe to call concurrently from whatever thread.
- This is not safe to call from within a signal handler.
- If the signal number was already registered previously, this is a no-op.
- If this errors, the original set of signals is left intact.
§Panics
- If the given signal is [forbidden][crate::FORBIDDEN].
- If the signal number is negative or larger than internal limit. The limit should be larger than any supported signal the OS supports.
- If the relevant
Exfiltrator
does not support this particular signal. The default [SignalOnly
] one supports all signals.
Sourcepub fn close(&self)
pub fn close(&self)
Closes the associated instance.
This is meant to signalize termination of the signal delivery process. After calling close:
is_closed
will return true.- All currently blocking operations of associated instances are interrupted and terminate.
- Any further operations will not block.
- Further signals may or may not be returned from the iterators. However, if any are returned, these are real signals that happened.
The goal is to be able to shut down any background thread that handles only the signals.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Handle
impl !RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl !UnwindSafe for Handle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more