[−][src]Struct scoped_signal::SignalScope
Install a signal handler only valid for a given scope
Methods
impl<Handler: Fn(u8, &SigInfo)> SignalScope<Handler>
[src]
pub unsafe fn new(
signal: Signal,
flags: SaFlags,
set: SigSet,
handler: Handler
) -> Self
[src]
signal: Signal,
flags: SaFlags,
set: SigSet,
handler: Handler
) -> Self
Create an object representing the provided signal handler. The handler is only called in the thread that run() is called from. If another thread receives the same signal, the signal will be ignored unless the thread is using its own SignalScope for the same signal
set
defines what signals are blocked during the execution of the signal handler itself
See sigaction(3P)
for more info
Safety
This is an unsafe operation because the passed handler
must only call async-signal-safe
functions and we cannot verify this
pub fn run<T, F: FnOnce() -> T>(self, f: F) -> Result<T, Error>
[src]
Run the given closure with this signal handler installed
Auto Trait Implementations
impl<F> RefUnwindSafe for SignalScope<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for SignalScope<F> where
F: Send,
F: Send,
impl<F> Sync for SignalScope<F> where
F: Sync,
F: Sync,
impl<F> Unpin for SignalScope<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for SignalScope<F> where
F: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,