pub struct SettingsDictionary;Expand description
A settings stage dictionary (startup / global / player_default).
Implementations§
Source§impl SettingsDictionary
impl SettingsDictionary
Sourcepub const fn get_bool(self, _name: &'static str) -> bool
pub const fn get_bool(self, _name: &'static str) -> bool
Read a bool setting: settings.startup["name"].value.
Sourcepub const fn get_double(self, _name: &'static str) -> f64
pub const fn get_double(self, _name: &'static str) -> f64
Read a double setting.
Sourcepub const fn get_string(self, _name: &'static str) -> &'static str
pub const fn get_string(self, _name: &'static str) -> &'static str
Read a string setting.
Sourcepub const fn get<T: SettingValue>(self, _name: &'static str) -> T
pub const fn get<T: SettingValue>(self, _name: &'static str) -> T
Fall back to the generic typed read used by older mods.
Sourcepub fn setting(self, _name: &'static str) -> ModSettingValue
pub fn setting(self, _name: &'static str) -> ModSettingValue
Index into a setting entry (.value still opaque for uncommon types).
Trait Implementations§
Source§impl Clone for SettingsDictionary
impl Clone for SettingsDictionary
Source§fn clone(&self) -> SettingsDictionary
fn clone(&self) -> SettingsDictionary
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SettingsDictionary
Source§impl Debug for SettingsDictionary
impl Debug for SettingsDictionary
Source§impl Default for SettingsDictionary
impl Default for SettingsDictionary
Source§fn default() -> SettingsDictionary
fn default() -> SettingsDictionary
Returns the “default value” for a type. Read more
impl Eq for SettingsDictionary
Source§impl Index<&str> for SettingsDictionary
impl Index<&str> for SettingsDictionary
Source§type Output = ModSettingValue
type Output = ModSettingValue
The returned type after indexing.
Source§impl PartialEq for SettingsDictionary
impl PartialEq for SettingsDictionary
impl StructuralPartialEq for SettingsDictionary
Auto Trait Implementations§
impl Freeze for SettingsDictionary
impl RefUnwindSafe for SettingsDictionary
impl Send for SettingsDictionary
impl Sync for SettingsDictionary
impl Unpin for SettingsDictionary
impl UnsafeUnpin for SettingsDictionary
impl UnwindSafe for SettingsDictionary
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