pub struct SettingDefinition { /* private fields */ }Expand description
One canonical semantic definition projected from an existing table entry.
Implementations§
Source§impl SettingDefinition
impl SettingDefinition
pub fn identity(&self) -> &SettingIdentity
pub fn id(&self) -> Option<&SettingId>
pub fn scope(&self) -> SettingScope
pub fn path(&self) -> &str
pub fn domain(&self) -> &SettingValueDomain
Sourcepub fn enum_members(&self) -> impl Iterator<Item = SettingEnumMember> + '_
pub fn enum_members(&self) -> impl Iterator<Item = SettingEnumMember> + '_
Enumerate the accepted members when this setting uses an enum value.
Boolean settings backed by an enum token (such as Enabled) expose
that token here as well.
pub fn target_kind(&self) -> SettingTargetKind
pub fn presentation(&self) -> &SettingPresentation
pub fn localized_name( &self, locale: &str, target: &SettingTarget, ) -> Result<Option<&'static str>, GameplayDataError>
pub fn source(&self) -> SettingSource
Sourcepub fn applicability(
&self,
target: &SettingTarget,
) -> Result<Applicability, GameplayDataError>
pub fn applicability( &self, target: &SettingTarget, ) -> Result<Applicability, GameplayDataError>
Query effective applicability without exposing table deduplication.
pub fn effective_number(&self, authored: f64) -> Option<EffectiveNumber>
Sourcepub fn read(
&self,
settings: &Settings,
target: &SettingTarget,
) -> Result<SettingOccurrence, SettingOperationError>
pub fn read( &self, settings: &Settings, target: &SettingTarget, ) -> Result<SettingOccurrence, SettingOperationError>
Read an existing source-preserving occurrence with its authored value and, when source-backed, its effective numeric value.
Sourcepub fn write(
&self,
settings: &mut Settings,
target: &SettingTarget,
value: SettingValue,
) -> Result<(), SettingOperationError>
pub fn write( &self, settings: &mut Settings, target: &SettingTarget, value: SettingValue, ) -> Result<(), SettingOperationError>
Update one existing occurrence without rebuilding the surrounding settings tree. Unknown and unrelated source structure is untouched.
Sourcepub fn source_edit(
&self,
source: &str,
settings: &Settings,
locale: &str,
target: &SettingTarget,
value: SettingValue,
) -> Result<SettingSourceEdit, SettingOperationError>
pub fn source_edit( &self, source: &str, settings: &Settings, locale: &str, target: &SettingTarget, value: SettingValue, ) -> Result<SettingSourceEdit, SettingOperationError>
Build a source-text edit for one existing scalar occurrence.
The caller retains the original source and applies the returned edit while its targeted bytes are unchanged. Comments, whitespace, and every other byte remain outside the edit range and are therefore preserved without assigning them comment/trivia ownership semantics.