pub struct ConfigWatcher {
config: RwLock<Arc<FullConfigType>>,
}Expand description
Thread-safe configuration holder with change notification. The actual file system watching will be integrated with the event loop in a later phase.
Fields§
§config: RwLock<Arc<FullConfigType>>Implementations§
Source§impl ConfigWatcher
impl ConfigWatcher
Sourcepub fn with_config(config: FullConfigType) -> Self
pub fn with_config(config: FullConfigType) -> Self
Create a new config watcher with initial config.
Sourcepub fn get_full_config(&self) -> Arc<FullConfigType>
pub fn get_full_config(&self) -> Arc<FullConfigType>
Get a snapshot of the current config.
Sourcepub fn get_settings(&self) -> SettingsType
pub fn get_settings(&self) -> SettingsType
Get just the settings.
Sourcepub fn set_config(&self, config: FullConfigType)
pub fn set_config(&self, config: FullConfigType)
Update the full config (called when files change).
Sourcepub fn update_settings(&self, settings: SettingsType)
pub fn update_settings(&self, settings: SettingsType)
Update just the settings portion.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ConfigWatcher
impl RefUnwindSafe for ConfigWatcher
impl Send for ConfigWatcher
impl Sync for ConfigWatcher
impl Unpin for ConfigWatcher
impl UnwindSafe for ConfigWatcher
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.