Trait arc_util::settings::HasSettings
source · pub trait HasSettings {
type Settings: Serialize + DeserializeOwned;
const SETTINGS_ID: &'static str;
// Required methods
fn current_settings(&self) -> Self::Settings;
fn load_settings(&mut self, loaded: Self::Settings);
// Provided method
fn reset_settings(&mut self)
where Self::Settings: Default { ... }
}
Expand description
Interface for components with settings.
Required Associated Types§
type Settings: Serialize + DeserializeOwned
Required Associated Constants§
sourceconst SETTINGS_ID: &'static str
const SETTINGS_ID: &'static str
The component’s settings id.
Required Methods§
sourcefn current_settings(&self) -> Self::Settings
fn current_settings(&self) -> Self::Settings
Returns the component’s current settings state.
sourcefn load_settings(&mut self, loaded: Self::Settings)
fn load_settings(&mut self, loaded: Self::Settings)
Loads the component’s settings from a loaded state.
Provided Methods§
sourcefn reset_settings(&mut self)
fn reset_settings(&mut self)
Resets the component’s settings to the defaults.
Object Safety§
This trait is not object safe.