Skip to main content

SubscriberList

Trait SubscriberList 

Source
pub trait SubscriberList: Send + Sync {
    // Required methods
    fn add(&self, subscriber: ReactiveContext);
    fn remove(&self, subscriber: &ReactiveContext);
    fn visit(&self, f: &mut dyn FnMut(&ReactiveContext));
}
Expand description

A list of subscribers that can be notified when the value changes. This is used to track when the value changes and notify subscribers.

Required Methods§

Source

fn add(&self, subscriber: ReactiveContext)

Add a subscriber to the list.

Source

fn remove(&self, subscriber: &ReactiveContext)

Remove a subscriber from the list.

Source

fn visit(&self, f: &mut dyn FnMut(&ReactiveContext))

Visit all subscribers in the list.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl SubscriberList for Mutex<HashSet<ReactiveContext>>

Source§

fn add(&self, subscriber: ReactiveContext)

Source§

fn remove(&self, subscriber: &ReactiveContext)

Source§

fn visit(&self, f: &mut dyn FnMut(&ReactiveContext))

Implementors§