Skip to main content

Settings

Trait Settings 

Source
pub trait Settings {
    // Required methods
    fn get_bool(&self, section: &str, name: &str, value: &mut bool);
    fn get_int(&self, section: &str, name: &str, value: &mut i32);
    fn set_bool(&mut self, section: &str, name: &str, value: bool);
    fn set_int(&mut self, section: &str, name: &str, value: i32);
}
Expand description

Where the mod list reads and writes its settings: the game’s Persistence, or a text::TextSettings. Names are made from a section and a name (ModEnabled_ and the file), as IO::Persistence does.

Required Methods§

Source

fn get_bool(&self, section: &str, name: &str, value: &mut bool)

Unchanged when absent; "true" is true, anything else false.

Source

fn get_int(&self, section: &str, name: &str, value: &mut i32)

Unchanged when absent or not a number.

Source

fn set_bool(&mut self, section: &str, name: &str, value: bool)

Store a bool as true or false.

Source

fn set_int(&mut self, section: &str, name: &str, value: i32)

Store a number.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§