SignalRead

Trait SignalRead 

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§

fn id(&self) -> Id

get the Signal Id

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.

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§

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

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

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

Reads the data stored in the Signal without subscribing.

Implementors§

§

impl<T> SignalRead<T> for ReadSignal<T>

§

impl<T> SignalRead<T> for Signal<T>

§

impl<T> SignalRead<T> for SyncReadSignal<T>
where T: Send + Sync,

§

impl<T> SignalRead<T> for SyncSignal<T>
where T: Send + Sync,