leptos::reactive::graph

Trait WithObserver

Source
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§

Source

fn with_observer<T>(&self, fun: impl FnOnce() -> T) -> T

Runs the given function with this subscriber as the thread-local Observer.

Source

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.

Implementations on Foreign Types§

Source§

impl WithObserver for Option<AnySubscriber>

Source§

fn with_observer<T>(&self, fun: impl FnOnce() -> T) -> T

Source§

fn with_observer_untracked<T>(&self, fun: impl FnOnce() -> T) -> T

Implementors§