SignalRead

Trait SignalRead 

Source
pub trait SignalRead<T> {
    // Required methods
    fn id(&self) -> Id;
    fn try_read(&self) -> Option<ReadRef<'_, T>>
       where T: 'static;
    fn try_read_untracked(&self) -> Option<ReadRef<'_, T>>
       where T: 'static;

    // Provided methods
    fn read(&self) -> ReadRef<'_, T>
       where T: 'static { ... }
    fn read_untracked(&self) -> ReadRef<'_, T>
       where T: 'static { ... }
}

Required Methods§

Source

fn id(&self) -> Id

get the Signal Id

Source

fn try_read(&self) -> Option<ReadRef<'_, T>>
where T: 'static,

If the signal isn’t disposed, reads the data stored in the Signal and subscribes to the current running effect.

Source

fn try_read_untracked(&self) -> Option<ReadRef<'_, T>>
where T: 'static,

If the signal isn’t disposed, reads the data stored in the Signal without subscribing.

Provided Methods§

Source

fn read(&self) -> ReadRef<'_, T>
where T: 'static,

Reads the data stored in the Signal, subscribing the current running effect.

Source

fn read_untracked(&self) -> ReadRef<'_, T>
where T: 'static,

Reads the data stored in the Signal without subscribing.

Implementors§

Source§

impl<T> SignalRead<T> for ReadSignal<T, UnsyncStorage>

Source§

impl<T> SignalRead<T> for RwSignal<T, UnsyncStorage>

Source§

impl<T: Send + Sync> SignalRead<T> for ReadSignal<T, SyncStorage>

Source§

impl<T: Send + Sync> SignalRead<T> for RwSignal<T, SyncStorage>