leptos::reactive::prelude

Trait Set

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

Source

type Value

The type of the value contained in the signal.

Required Methods§

Source

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

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

Source

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§

Source§

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

Source§

type Value = <T as Update>::Value

Source§

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

Source§

type Value = T