Skip to main content

ReloadHandle

Trait ReloadHandle 

Source
pub trait ReloadHandle<L> {
    // Required methods
    fn current(&self) -> Option<L>;
    fn reload(&self, new_value: L) -> Result<(), Error>;
}
Expand description

Type-erased interface to a tracing subscriber reload handle.

The subscriber type in reload::Handle<L, S> depends on preceding layers and can include unnameable impl Trait types. This interface hides S so handles can be stored as trait objects.

Required Methods§

Source

fn current(&self) -> Option<L>

Clones the filter currently installed through this handle.

A missing value indicates that the subscriber or reload layer is no longer available. The type-erased interface preserves the concrete layer value.

Source

fn reload(&self, new_value: L) -> Result<(), Error>

Replaces the layer value controlled by this handle.

Reloading affects future subscriber decisions without reconstructing the subscriber stack. The underlying reload layer reports unavailable state.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<L: Clone, S> ReloadHandle<L> for Handle<L, S>

Source§

fn current(&self) -> Option<L>

Source§

fn reload(&self, new_value: L) -> Result<(), Error>

Implementors§