pub trait Config:
Default
+ PartialEq
+ DeserializeOwned
+ Serialize {
// Required methods
fn field(&mut self, key: &str) -> Option<ConfigValueMut<'_>>;
fn migration_version(&self) -> Option<u32>;
fn set_migration_version(&mut self, _version: u32) -> bool;
fn list_available_fields(&self) -> &'static [ConfigField];
// Provided methods
fn reset_client_id(
&self,
_key: &str,
) -> Option<(&'static Path, &'static ResetSignalAllocation)> { ... }
fn reset_client_config(&mut self, _key: &str) -> ResetConfigResult { ... }
}Required Methods§
fn field(&mut self, key: &str) -> Option<ConfigValueMut<'_>>
Sourcefn migration_version(&self) -> Option<u32>
fn migration_version(&self) -> Option<u32>
The migration version
Return None if the configuration does not support storing the migration version
Sourcefn set_migration_version(&mut self, _version: u32) -> bool
fn set_migration_version(&mut self, _version: u32) -> bool
Set the migration version
Return false if the configuration does not support storing the migration version
fn list_available_fields(&self) -> &'static [ConfigField]
Provided Methods§
Sourcefn reset_client_id(
&self,
_key: &str,
) -> Option<(&'static Path, &'static ResetSignalAllocation)>
fn reset_client_id( &self, _key: &str, ) -> Option<(&'static Path, &'static ResetSignalAllocation)>
Client ID to factory-reset if the associated configuration option is changed
§If the Request is for a client_id:
- MUST return
Someto indicate that the client can be factory reset by the admin app, In that case, the path is the clientid that must be reset, and the allocation must point to a signal that id checked by the application. - MUST return None otherwise.
Sourcefn reset_client_config(&mut self, _key: &str) -> ResetConfigResult
fn reset_client_config(&mut self, _key: &str) -> ResetConfigResult
Reset the config of a client to its default value
Returns true if the config has been changed as a result
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".