[−][src]Struct reopen::Handle
A handle to signal a companion Reopen
object to do a reopen on its next operation.
Cloning creates interchangeable handles (they all control the same Reopen
). Cloning is
cheap (it's only an Arc
in disguise).
Implementations
impl Handle
[src]
pub fn register_signal(&self, signal: c_int) -> Result<SigId, Error>
[src]
Installs a signal handler to invoke the reopening when a certain signal comes.
Features
This is available only with the signals
feature enabled.
Notes
- Under the hood, this uses the
signal-hook
crate, so the same signal can be shared with other actions (to eg. also reload a configuration). - The same restrictions, errors and panics as in the case of
signal_hook::register
apply. - This installs a signal handler. Signal handlers are program-global entities, so you may be careful.
- If there are multiple handles for the same signal, they share their signal handler ‒ only the first one for each signal registers one.
- Upon signal registration, the original handler is stored and called in chain from our own signal handler.
- A single handle can be used for multiple signals.
- To unregister a handle from a signal handle, use the returned
SigId
and thesignal_hook::unregister
.
impl Handle
[src]
pub fn reopen(&self)
[src]
Signals the companion Reopen
object to do a reopen on its next
operation.
pub fn stub() -> Self
[src]
Creates an unpaired handle, not connected to any ['Reopen'].
It can be added to a new Reopen
later on with with_handle
.
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
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,