pub trait Monitor<T: Value> {
// Required methods
fn get_named(&self, name: &str) -> Result<Ref<T>, Error>;
fn on_change(
&self,
changed: Box<dyn Fn(&str, Ref<T>) + Send + Sync>,
) -> Subscription<T>;
// Provided methods
fn get(&self) -> Result<Ref<T>, Error> { ... }
fn get_unchecked(&self) -> Ref<T> { ... }
fn get_named_unchecked(&self, name: &str) -> Ref<T> { ... }
}Expand description
Defines the behavior for notifications when options instances change.
Required Methods§
Sourcefn get_named(&self, name: &str) -> Result<Ref<T>, Error>
fn get_named(&self, name: &str) -> Result<Ref<T>, Error>
Gets the configuration options with the given name.
§Arguments
name- The name associated with the options.
Provided Methods§
Sourcefn get_unchecked(&self) -> Ref<T>
fn get_unchecked(&self) -> Ref<T>
Gets the default, unnamed configuration options.
§Remarks
This function panics if the configuration options could not be successfully retrieved.