pub struct DefaultMonitor<T: Value> { /* private fields */ }Expand description
Represents the default implementation for notifications when option instances change.
Implementations§
Source§impl<T: Value + 'static> DefaultMonitor<T>
impl<T: Value + 'static> DefaultMonitor<T>
Sourcepub fn new(
cache: Ref<Cache<T>>,
sources: Vec<Ref<dyn ChangeTokenSource<T>>>,
factory: Ref<dyn Factory<T>>,
) -> Self
Available on non-crate feature async only.
pub fn new( cache: Ref<Cache<T>>, sources: Vec<Ref<dyn ChangeTokenSource<T>>>, factory: Ref<dyn Factory<T>>, ) -> Self
async only.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: Value + Default + 'static> From<DefaultFactory<T>> for DefaultMonitor<T>
impl<T: Value + Default + 'static> From<DefaultFactory<T>> for DefaultMonitor<T>
Source§fn from(factory: DefaultFactory<T>) -> Self
fn from(factory: DefaultFactory<T>) -> Self
Converts to this type from the input type.
Source§impl<T: Value> Monitor<T> for DefaultMonitor<T>
impl<T: Value> Monitor<T> for DefaultMonitor<T>
Source§fn 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. Read more
Source§fn on_change(
&self,
changed: Box<dyn Fn(&str, Ref<T>) + Send + Sync>,
) -> Subscription<T>
fn on_change( &self, changed: Box<dyn Fn(&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 get_unchecked(&self) -> Ref<T>
fn get_unchecked(&self) -> Ref<T>
Gets the default, unnamed configuration options. Read more
Auto Trait Implementations§
impl<T> Freeze for DefaultMonitor<T>
impl<T> !RefUnwindSafe for DefaultMonitor<T>
impl<T> !Send for DefaultMonitor<T>
impl<T> !Sync for DefaultMonitor<T>
impl<T> Unpin for DefaultMonitor<T>
impl<T> UnsafeUnpin for DefaultMonitor<T>
impl<T> !UnwindSafe for DefaultMonitor<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