Trait SignalWrite

Source
pub trait SignalWrite<T> {
    // Required method
    fn id(&self) -> Id;

    // Provided methods
    fn write(&self) -> WriteSignalValue<T>
       where T: 'static { ... }
    fn try_write(&self) -> Option<WriteSignalValue<T>>
       where T: 'static { ... }
}

Required Methods§

Source

fn id(&self) -> Id

get the Signal Id

Provided Methods§

Source

fn write(&self) -> WriteSignalValue<T>
where T: 'static,

Convert the Signal to WriteSignalValue where it holds a RefCell wrapped original data of the signal, so that you can borrow_mut() to update the data.

When WriteSignalValue drops, it triggers effect run

Source

fn try_write(&self) -> Option<WriteSignalValue<T>>
where T: 'static,

If the Signal isn’t disposed, convert the Signal to WriteSignalValue where it holds a RefCell wrapped original data of the signal, so that you can borrow_mut() to update the data.

When WriteSignalValue drops, it triggers effect run

Implementors§

Source§

impl<T> SignalWrite<T> for RwSignal<T>

Source§

impl<T> SignalWrite<T> for WriteSignal<T>