pub struct ConfigProfile { /* private fields */ }Expand description
Configuration profile (matching C++ ConfigProfile singleton)
Implementations§
Source§impl ConfigProfile
impl ConfigProfile
Sourcepub fn init<P: AsRef<Path>>(config_file: P) -> Result<Self>
pub fn init<P: AsRef<Path>>(config_file: P) -> Result<Self>
Initialize from a config file
Config file format (matching C++ .cfg format):
[section1]
key1=value1
key2=value2
[section2]
key.subkey=valueSourcepub fn get_section(&self, name: &str) -> Option<&ConfigSection>
pub fn get_section(&self, name: &str) -> Option<&ConfigSection>
Get a section by name
Sourcepub fn get_section_mut(&mut self, name: &str) -> Option<&mut ConfigSection>
pub fn get_section_mut(&mut self, name: &str) -> Option<&mut ConfigSection>
Get a mutable section by name
Sourcepub fn get_string(&self, section: &str, key: &str, default: &str) -> String
pub fn get_string(&self, section: &str, key: &str, default: &str) -> String
Get a string value from a specific section
Sourcepub fn get_integer(&self, section: &str, key: &str, default: i32) -> i32
pub fn get_integer(&self, section: &str, key: &str, default: i32) -> i32
Get an integer value from a specific section
Sourcepub fn get_u32(&self, section: &str, key: &str, default: u32) -> u32
pub fn get_u32(&self, section: &str, key: &str, default: u32) -> u32
Get a u32 value from a specific section
Trait Implementations§
Source§impl Clone for ConfigProfile
impl Clone for ConfigProfile
Source§fn clone(&self) -> ConfigProfile
fn clone(&self) -> ConfigProfile
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 moreSource§impl Debug for ConfigProfile
impl Debug for ConfigProfile
Auto Trait Implementations§
impl Freeze for ConfigProfile
impl RefUnwindSafe for ConfigProfile
impl Send for ConfigProfile
impl Sync for ConfigProfile
impl Unpin for ConfigProfile
impl UnwindSafe for ConfigProfile
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