[][src]Struct reopen::Handle

pub struct 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 the signal_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

impl Clone for Handle[src]

impl Debug for Handle[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.