pub struct SubSettingsConfig {
pub name: String,
pub extension: Option<String>,
pub migrator: Option<Arc<dyn Fn(Value) -> Value + Send + Sync>>,
pub schema: Option<Arc<HashMap<String, SettingMetadata>>>,
pub mode: SubSettingsMode,
pub cache_strategy: CacheStrategy,
pub profiles_enabled: bool,
pub profile_migrator: ProfileMigrator,
}Expand description
Sub-settings for per-entity configuration. Configuration for a sub-settings type.
Fields§
§name: StringName of this sub-settings type
extension: Option<String>File extension for entries (default: derived from storage backend)
migrator: Option<Arc<dyn Fn(Value) -> Value + Send + Sync>>Optional migration function for schema changes
schema: Option<Arc<HashMap<String, SettingMetadata>>>Optional schema metadata for validating sub-settings entries
mode: SubSettingsModeStorage mode (MultiFile or SingleFile)
cache_strategy: CacheStrategyCache strategy for this sub-settings type
profiles_enabled: boolWhether profiles are enabled for this sub-settings type
profile_migrator: ProfileMigratorProfile migration strategy (defaults to Auto)
Implementations§
Source§impl SubSettingsConfig
impl SubSettingsConfig
pub fn new(name: impl Into<String>) -> Self
pub fn singlefile(name: impl Into<String>) -> Self
pub fn with_cache(self, strategy: CacheStrategy) -> Self
pub fn with_lru_cache(self, max_entries: usize) -> Self
pub fn with_no_cache(self) -> Self
pub fn with_extension(self, ext: impl Into<String>) -> Self
pub fn with_migrator<F>(self, migrator: F) -> Self
pub fn with_metadata(self, metadata: HashMap<String, SettingMetadata>) -> Self
pub fn with_schema<Schema: SettingsSchema>(self) -> Self
pub fn with_profiles(self) -> Self
pub fn with_profile_migrator(self, migrator: ProfileMigrator) -> Self
Trait Implementations§
Source§impl Clone for SubSettingsConfig
impl Clone for SubSettingsConfig
Source§fn clone(&self) -> SubSettingsConfig
fn clone(&self) -> SubSettingsConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SubSettingsConfig
impl !RefUnwindSafe for SubSettingsConfig
impl Send for SubSettingsConfig
impl Sync for SubSettingsConfig
impl Unpin for SubSettingsConfig
impl UnsafeUnpin for SubSettingsConfig
impl !UnwindSafe for SubSettingsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more