Trait SignalGet

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

    // Provided methods
    fn get_untracked(&self) -> T
       where T: 'static { ... }
    fn get(&self) -> T
       where T: 'static { ... }
    fn try_get(&self) -> Option<T>
       where T: 'static { ... }
    fn try_get_untracked(&self) -> Option<T>
       where T: 'static { ... }
}

Required Methods§

Source

fn id(&self) -> Id

get the Signal Id

Provided Methods§

Source

fn get_untracked(&self) -> T
where T: 'static,

Clones and returns the current value stored in the Signal, but it doesn’t subscribe to the current running effect.

Source

fn get(&self) -> T
where T: 'static,

Clones and returns the current value stored in the Signal, and subscribes to the current running effect to this Signal.

Source

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

Try to clone and return the current value stored in the Signal, and returns None if it’s already disposed. It subscribes to the current running effect.

Source

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

Try to clone and return the current value stored in the Signal, and returns None if it’s already disposed. It doesn’t subscribe to the current running effect.

Implementors§

Source§

impl<T: Clone + 'static, O: Clone, GF: Fn(&T) -> O + Copy, UF: Fn(&O) -> T + Copy> SignalGet<O> for DerivedRwSignal<T, O, GF, UF>

Source§

impl<T: Clone> SignalGet<T> for BaseSignal<T>

Source§

impl<T: Clone> SignalGet<T> for Memo<T>

Source§

impl<T: Clone> SignalGet<T> for ReadSignal<T>

Source§

impl<T: Clone> SignalGet<T> for RwSignal<T>