Skip to main content

SettingsAware

Trait SettingsAware 

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

A type that’s aware of the settings value

Required Methods§

Source

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

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SettingsAware for Arc<RwLock<Settings>>

Source§

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

Source§

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

Implementors§