pub struct WithRawSiginfo;
Expand description

The Exfiltrator that produces the raw libc::siginfo_t. Note that it might look differently on different OSes and its API is a little bit more limited than its C counterpart.

You might prefer the [WithOrigin][super::WithOrigin] if you simply need information about the origin of the signal.

Examples

// Subscribe to SIGUSR1, with information about the process.
let mut signals = SignalsInfo::<WithRawSiginfo>::new(&[SIGUSR1])?;

// Send ourselves a signal.
signal_hook::low_level::raise(SIGUSR1)?;

// Grab the signal and look into the details.
let received = signals.wait().next().unwrap();

// Not much else is useful in a cross-platform way :-(
assert_eq!(SIGUSR1, received.si_signo);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.