pub trait OptionsMonitor<T> {
    fn current_value(&self) -> &T;
    fn get(&self, name: Option<&str>) -> &T;
    fn on_change(&self, listener: Weak<dyn Fn(Option<&str>, &T)>);
}
Expand description

Defines the behavior for notifications when option instances change.

Required Methods

Returns the current instance with the default options name.

Returns a configured instance with the given name.

Arguments
  • name - the name associated with the options.

Registers a callback function to be invoked when the configured instance with the given name changes.

Arguments
  • listener - a weak reference to callback function to invoke

Implementors