pub trait ValidatedSetting {
// Required method
fn validate(&mut self);
}Expand description
Trait for validating and normalizing setting values.
Mandatory to implement for all types used with SettingsPlugin.
Called automatically:
- after loading from a file (or
S::default()if the file does not exist), - after
ReloadSetting, - before saving (
PersistSettingandPersistAllSettings), - when a new value is provided in
PersistSetting { value: Some(...) }.
If validation is not needed, implement the method as empty.