pub trait PropertyObserverContainer {
// Required methods
fn observe_with_handle<F>(&self, name: &str, subscriber: F) -> u128
where F: FnMut(&Value) + 'static + Send;
fn propagate(&self, name: &str, target_property_name: &str);
fn remove_observer(&self, name: &str, handle_id: u128);
fn remove_observers(&self, name: &str);
fn remove_all_observers(&self);
}
Expand description
A PropertyObserverContainer manages the observers of a PropertyContainer.
Internally it stores the handle ids of created observers. This makes it possible to remove the observers for a single property by name or for all properties.
Required Methods§
Sourcefn observe_with_handle<F>(&self, name: &str, subscriber: F) -> u128
fn observe_with_handle<F>(&self, name: &str, subscriber: F) -> u128
Observes the property with the given name. A handle will be automatically created and stored
Sourcefn propagate(&self, name: &str, target_property_name: &str)
fn propagate(&self, name: &str, target_property_name: &str)
Propagates the value from the property with the given name to the target property with the given name.
Sourcefn remove_observer(&self, name: &str, handle_id: u128)
fn remove_observer(&self, name: &str, handle_id: u128)
Removes the observers of the property with the given name and the given observer handle.
Sourcefn remove_observers(&self, name: &str)
fn remove_observers(&self, name: &str)
Removes all observers of the property with the given name that are managed by this PropertyObserverContainer.
Sourcefn remove_all_observers(&self)
fn remove_all_observers(&self)
Removes all observers that are managed by this PropertyObserverContainer.
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.