pub struct SettingsKey<T: 'static> {
pub key: &'static str,
pub default: fn() -> T,
}Expand description
A statically-named setting. Centralizes the dotted key, the value
type, and the default factory. Construct as a const:
use teksilo_settings::SettingsKey;
const FONT_SIZE: SettingsKey<f32> =
SettingsKey::new("editor.font_size", || 14.0);Fields§
§key: &'static strThe dotted TOML path used to look up this setting (e.g. "editor.font_size").
default: fn() -> TFactory that produces the default value when the key is absent from disk.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for SettingsKey<T>
impl<T> RefUnwindSafe for SettingsKey<T>
impl<T> Send for SettingsKey<T>
impl<T> Sync for SettingsKey<T>
impl<T> Unpin for SettingsKey<T>
impl<T> UnsafeUnpin for SettingsKey<T>
impl<T> UnwindSafe for SettingsKey<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