pub trait WithObserver {
// Required methods
fn with_observer<T>(&self, fun: impl FnOnce() -> T) -> T;
fn with_observer_untracked<T>(&self, fun: impl FnOnce() -> T) -> T;
}
Expand description
Runs code with some subscriber as the thread-local Observer
.
Required Methods§
Sourcefn with_observer<T>(&self, fun: impl FnOnce() -> T) -> T
fn with_observer<T>(&self, fun: impl FnOnce() -> T) -> T
Runs the given function with this subscriber as the thread-local Observer
.
Sourcefn with_observer_untracked<T>(&self, fun: impl FnOnce() -> T) -> T
fn with_observer_untracked<T>(&self, fun: impl FnOnce() -> T) -> T
Runs the given function with this subscriber as the thread-local Observer
,
but without tracking dependencies.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.