Struct reopen::Handle[][src]

pub struct Handle(_);
Expand description

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

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.

Signals the companion Reopen object to do a reopen on its next operation.

Creates an unpaired handle, not connected to any [‘Reopen’].

It can be added to a new Reopen later on with with_handle.

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

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

Performs the conversion.

Performs the conversion.

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)

recently added

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.