Trait WithUntracked

Source
pub trait WithUntracked: DefinedAt {
    type Value: ?Sized;

    // Required method
    fn try_with_untracked<U>(
        &self,
        fun: impl FnOnce(&Self::Value) -> U,
    ) -> Option<U>;

    // Provided method
    fn with_untracked<U>(&self, fun: impl FnOnce(&Self::Value) -> U) -> U { ... }
}
Expand description

Give read-only access to a signal’s value by reference inside a closure, without tracking the value reactively.

Required Associated Types§

Source

type Value: ?Sized

The type of the value contained in the signal.

Required Methods§

Source

fn try_with_untracked<U>( &self, fun: impl FnOnce(&Self::Value) -> U, ) -> Option<U>

Applies the closure to the value, and returns the result, or None if the signal has already been disposed.

Provided Methods§

Source

fn with_untracked<U>(&self, fun: impl FnOnce(&Self::Value) -> U) -> U

Applies the closure to the value, and returns the result.

§Panics

Panics if you try to access a signal that has been disposed.

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.

Implementors§