pub trait Setting: Sized {
// Required methods
fn to_setting(self) -> SettingValue;
fn from_setting(value: &SettingValue) -> Option<Self>;
}Expand description
A Rust type that can be read from and written to settings.
Implemented for bool, String, the integer types, f32, f64 and Vec<String>. Integers
are stored as i64; a u64 or usize above i64::MAX is stored as i64::MAX.
Required Methods§
Sourcefn to_setting(self) -> SettingValue
fn to_setting(self) -> SettingValue
The stored form.
Sourcefn from_setting(value: &SettingValue) -> Option<Self>
fn from_setting(value: &SettingValue) -> Option<Self>
Reads a stored value; None when it has another type or does not fit.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".