Struct options::DefaultOptionsMonitor 
source · pub struct DefaultOptionsMonitor<T> { /* private fields */ }Expand description
Represents the default implementation for notifications when option instances change.
Implementations§
source§impl<T: 'static> DefaultOptionsMonitor<T>
 
impl<T: 'static> DefaultOptionsMonitor<T>
sourcepub fn new(
    cache: Ref<dyn OptionsMonitorCache<T>>,
    sources: Vec<Ref<dyn OptionsChangeTokenSource<T>>>,
    factory: Ref<dyn OptionsFactory<T>>
) -> Self
 
pub fn new( cache: Ref<dyn OptionsMonitorCache<T>>, sources: Vec<Ref<dyn OptionsChangeTokenSource<T>>>, factory: Ref<dyn OptionsFactory<T>> ) -> Self
Initializes a new default options monitor.
Arguments
cache- The cache used for monitored optionssources- The source tokens used to track option changesfactory- The factory used to create new options
Trait Implementations§
source§impl<T> OptionsMonitor<T> for DefaultOptionsMonitor<T>
 
impl<T> OptionsMonitor<T> for DefaultOptionsMonitor<T>
source§fn get(&self, name: Option<&str>) -> Ref<T>
 
fn get(&self, name: Option<&str>) -> Ref<T>
Returns a configured instance with the given name. Read more
source§fn on_change(
    &self,
    listener: Box<dyn Fn(Option<&str>, Ref<T>) + Send + Sync>
) -> Subscription<T>
 
fn on_change( &self, listener: Box<dyn Fn(Option<&str>, Ref<T>) + Send + Sync> ) -> Subscription<T>
Registers a callback function to be invoked when the configured instance with the given name changes. Read more
source§fn current_value(&self) -> Ref<T>
 
fn current_value(&self) -> Ref<T>
Returns the current instance with the default options name.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for DefaultOptionsMonitor<T>
impl<T> !Send for DefaultOptionsMonitor<T>
impl<T> !Sync for DefaultOptionsMonitor<T>
impl<T> Unpin for DefaultOptionsMonitor<T>
impl<T> !UnwindSafe for DefaultOptionsMonitor<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more