Skip to main content

ValidatedSetting

Trait ValidatedSetting 

Source
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 (PersistSetting and PersistAllSettings),
  • when a new value is provided in PersistSetting { value: Some(...) }.

If validation is not needed, implement the method as empty.

Required Methods§

Source

fn validate(&mut self)

Implementors§