Skip to main content

Observable

Trait Observable 

Source
pub trait Observable<T> {
    // Required methods
    fn source_id(&self) -> SourceId;
    fn source_name(&self) -> Arc<str> ⓘ;
    fn get(&self) -> T;
    fn subscribe(&self, observer: Observer) -> Subscription;
}
Expand description

Readable value that can notify subscribers after meaningful changes.

SUI’s runtime consumes this trait, so applications may provide adapters for reducer stores, channels, actor snapshots, or other state architectures.

Required Methods§

Source

fn source_id(&self) -> SourceId

Source

fn source_name(&self) -> Arc<str> ⓘ

Source

fn get(&self) -> T

Source

fn subscribe(&self, observer: Observer) -> Subscription

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Observable<u64> for RichDocumentModel

Source§

impl<K, T> Observable<u64> for VirtualCollectionModel<K, T>
where K: Clone + Eq + Hash + 'static, T: Clone + PartialEq + 'static,

Source§

impl<S, I, O> Observable<O> for Selector<S, I, O>
where S: Observable<I> + Clone + Send + Sync + 'static, I: Clone + Send + Sync + 'static, O: Clone + PartialEq + Send + Sync + 'static,

Source§

impl<T> Observable<T> for Signal<T>
where T: Clone + 'static,