Trait Set

pub trait Set {
    type Value;

    // Required methods
    fn set(&self, value: Self::Value);
    fn try_set(&self, value: Self::Value) -> Option<Self::Value>;
}
Expand description

Updates the value of the signal by replacing it.

Required Associated Types§

type Value

The type of the value contained in the signal.

Required Methods§

fn set(&self, value: Self::Value)

Updates the value by replacing it, and notifies subscribers that it has changed.

fn try_set(&self, value: Self::Value) -> Option<Self::Value>

Updates the value by replacing it, and notifies subscribers that it has changed.

If the signal has already been disposed, returns Some(value) with the value that was passed in. Otherwise, returns None.

Implementors§

§

impl<T> Set for T
where T: Update + IsDisposed,

§

type Value = <T as Update>::Value

§

impl<T, S> Set for SignalSetter<T, S>
where T: 'static, S: Storage<ArcWriteSignal<T>> + Storage<Box<dyn Fn(T) + Send + Sync>>,

§

type Value = T