pub struct Handle<S> { /* private fields */ }
std
only.Expand description
Allows reloading the state of an associated Collect
.
Implementations§
Source§impl<T> Handle<T>
impl<T> Handle<T>
Sourcepub fn reload(&self, new_value: impl Into<T>) -> Result<(), Error>
pub fn reload(&self, new_value: impl Into<T>) -> Result<(), Error>
Replace the current subscriber or filter with the provided new_value
.
Handle::reload
cannot be used with the Filtered
subscriber; use Handle::modify
instead (see this issue for additional details).
However, if the only the Filter
needs to be modified,
use reload::Subscriber
to wrap the Filter
directly.
Sourcepub fn modify(&self, f: impl FnOnce(&mut T)) -> Result<(), Error>
pub fn modify(&self, f: impl FnOnce(&mut T)) -> Result<(), Error>
Invokes a closure with a mutable reference to the current subscriber, allowing it to be modified in place.
Sourcepub fn clone_current(&self) -> Option<T> ⓘwhere
T: Clone,
pub fn clone_current(&self) -> Option<T> ⓘwhere
T: Clone,
Returns a clone of the subscriber’s current value if it still exists.
Otherwise, if the collector has been dropped, returns None
.