pub struct Handle { /* private fields */ }
Expand description
Implementations
sourceimpl Handle
impl Handle
sourcepub fn add_signal(&self, signal: c_int) -> Result<(), Error>
pub fn add_signal(&self, signal: c_int) -> 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 !RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl !UnwindSafe for Handle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more