Skip to main content

SettingDefinition

Struct SettingDefinition 

Source
pub struct SettingDefinition { /* private fields */ }
Expand description

One canonical semantic definition projected from an existing table entry.

Implementations§

Source§

impl SettingDefinition

Source

pub fn identity(&self) -> &SettingIdentity

Source

pub fn id(&self) -> Option<&SettingId>

Source

pub fn scope(&self) -> SettingScope

Source

pub fn path(&self) -> &str

Source

pub fn domain(&self) -> &SettingValueDomain

Source

pub fn target_kind(&self) -> SettingTargetKind

Source

pub fn presentation(&self) -> &SettingPresentation

Source

pub fn localized_name( &self, locale: &str, target: &SettingTarget, ) -> Result<Option<&'static str>, GameplayDataError>

Source

pub fn provenance(&self) -> SettingProvenance

Source

pub fn applicability( &self, target: &SettingTarget, ) -> Result<Applicability, GameplayDataError>

Query effective applicability without exposing table deduplication.

Source

pub fn effective_number(&self, authored: f64) -> Option<EffectiveNumber>

Source

pub fn read( &self, settings: &Settings, target: &SettingTarget, ) -> Result<SettingOccurrence, SettingOperationError>

Read an existing source-preserving occurrence with its authored value and, when evidenced, its effective numeric value.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for SettingDefinition

Source§

fn clone(&self) -> SettingDefinition

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SettingDefinition

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SettingDefinition

Source§

fn eq(&self, other: &SettingDefinition) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SettingDefinition

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.