Skip to main content

UpdateUntracked

Trait UpdateUntracked 

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§

type Value

The type of the value contained in the signal.

Required Methods§

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§

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".

Implementors§

§

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

§

type Value = <T as Write>::Value