leptos::reactive::prelude

Trait UpdateUntracked

Source
pub trait UpdateUntracked: DefinedAt {
    type Value;

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

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

Updates the value of a signal by applying a function that updates it in place, without notifying subscribers.

Required Associated Types§

Source

type Value

The type of the value contained in the signal.

Required Methods§

Source

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

Updates the value by applying a function, returning the value returned by that function, or None if the signal has already been disposed. Does not notify subscribers that the signal has changed.

Provided Methods§

Source

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

Updates the value by applying a function, returning the value returned by that function. Does not notify subscribers that the signal has changed.

§Panics

Panics if you try to update 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§

Source§

impl<T> UpdateUntracked for T
where T: Write,

Source§

type Value = <T as Write>::Value