Struct signal_hook::iterator::exfiltrator::origin::WithOrigin
source · pub struct WithOrigin(_);Available on non-Windows and crate feature
iterator and crate feature extended-siginfo only.Expand description
The Exfiltrator that produces Origin of
signals.
Examples
// Subscribe to SIGUSR1, with information about the process.
let mut signals = SignalsInfo::<WithOrigin>::new(&[SIGUSR1])?;
// Send a signal to ourselves.
let my_pid = unsafe { libc::getpid() };
unsafe { libc::kill(my_pid, SIGUSR1) };
// Grab the signal and look into the details.
let received = signals.wait().next().unwrap();
assert_eq!(SIGUSR1, received.signal);
assert_eq!(my_pid, received.process.unwrap().pid);Trait Implementations§
source§impl Clone for WithOrigin
impl Clone for WithOrigin
source§fn clone(&self) -> WithOrigin
fn clone(&self) -> WithOrigin
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for WithOrigin
impl Debug for WithOrigin
source§impl Default for WithOrigin
impl Default for WithOrigin
source§fn default() -> WithOrigin
fn default() -> WithOrigin
Returns the “default value” for a type. Read more
impl Copy for WithOrigin
Auto Trait Implementations§
impl RefUnwindSafe for WithOrigin
impl Send for WithOrigin
impl Sync for WithOrigin
impl Unpin for WithOrigin
impl UnwindSafe for WithOrigin
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