Trait SettingsAware

Source
pub trait SettingsAware {
    // Required methods
    fn with_settings<F, R>(&self, func: F) -> R
       where F: FnOnce(&Settings) -> R;
    fn with_settings_mut<F, R>(&mut self, func: F) -> R
       where F: FnOnce(&mut Settings) -> R;
}
Expand description

A type that’s aware of the settings value

Required Methods§

Source

fn with_settings<F, R>(&self, func: F) -> R
where F: FnOnce(&Settings) -> R,

Source

fn with_settings_mut<F, R>(&mut self, func: F) -> R
where F: FnOnce(&mut Settings) -> R,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SettingsAware for Arc<RwLock<RawRwLock, Settings>>

Source§

fn with_settings<F, R>(&self, func: F) -> R
where F: FnOnce(&Settings) -> R,

Source§

fn with_settings_mut<F, R>(&mut self, func: F) -> R
where F: FnOnce(&mut Settings) -> R,

Implementors§