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§
Sourcefn tick_checked(&self)
fn tick_checked(&self)
Sends the current value down the stream if mutable.
Sourcefn has_property(&self, name: &str) -> bool
fn has_property(&self, name: &str) -> bool
Returns true, if a property with the given name exists.
Sourcefn add_property<S: Into<String>>(
&self,
name: S,
mutability: Mutability,
value: Value,
)
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.
Sourcefn add_property_by_type(&self, property: &PropertyType)
fn add_property_by_type(&self, property: &PropertyType)
Adds a reactive property with the given name and the given initial value.
Sourcefn remove_property<S: Into<String>>(&self, name: S)
fn remove_property<S: Into<String>>(&self, name: S)
Removes the reactive property with the given name.
Sourcefn observe_with_handle<F>(&self, name: &str, subscriber: F, handle_id: u128)
fn observe_with_handle<F>(&self, name: &str, subscriber: F, handle_id: u128)
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.
Sourcefn remove_observer(&self, name: &str, handle_id: u128)
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.
Sourcefn remove_observers(&self, name: &str)
fn remove_observers(&self, name: &str)
Removes the subscribers of the property with the given name.
Sourcefn remove_all_observers(&self)
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.