Trait ReactivePropertyContainer

Source
pub trait ReactivePropertyContainer {
    // Required methods
    fn tick_checked(&self);
    fn tick(&self);
    fn has_property(&self, name: &str) -> bool;
    fn add_property<S: Into<String>>(
        &self,
        name: S,
        mutability: Mutability,
        value: Value,
    );
    fn add_property_by_type(&self, property: &PropertyType);
    fn remove_property<S: Into<String>>(&self, name: S);
    fn observe_with_handle<F>(&self, name: &str, subscriber: F, handle_id: u128)
       where F: FnMut(&Value) + 'static + Send;
    fn remove_observer(&self, name: &str, handle_id: u128);
    fn remove_observers(&self, name: &str);
    fn remove_all_observers(&self);
}

Required Methods§

Source

fn tick_checked(&self)

Sends the current value down the stream if mutable.

Source

fn tick(&self)

Sends the current value down the stream.

Source

fn has_property(&self, name: &str) -> bool

Returns true, if a property with the given name exists.

Source

fn add_property<S: Into<String>>( &self, name: S, mutability: Mutability, value: Value, )

Adds a reactive property with the given name and the given initial value.

Source

fn add_property_by_type(&self, property: &PropertyType)

Adds a reactive property with the given name and the given initial value.

Source

fn remove_property<S: Into<String>>(&self, name: S)

Removes the reactive property with the given name.

Source

fn observe_with_handle<F>(&self, name: &str, subscriber: F, handle_id: u128)
where F: FnMut(&Value) + 'static + Send,

Observe the stream output flowing out of the stream of the property with the given name. The handle_id allows to remove the observer again.

Source

fn remove_observer(&self, name: &str, handle_id: u128)

Removes the subscriber with the given handle_id from the stream of the property with the given name.

Source

fn remove_observers(&self, name: &str)

Removes the subscribers of the property with the given name.

Source

fn remove_all_observers(&self)

Removes all subscribers of all properties.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§