pub struct Config { /* private fields */ }
Expand description
Allegro configuration.
Wraps ALLEGRO_CONFIG.
Implementations
sourceimpl Config
impl Config
pub unsafe fn wrap(config: *mut ALLEGRO_CONFIG, own: bool) -> Config
sourcepub fn get_allegro_config(&self) -> *mut ALLEGRO_CONFIG
pub fn get_allegro_config(&self) -> *mut ALLEGRO_CONFIG
Returns the wrapped ALLEGRO_CONFIG.
sourcepub fn add_section(&mut self, name: &str)
pub fn add_section(&mut self, name: &str)
Adds an empty section with the specified name.
sourcepub fn remove_section(&mut self, name: &str) -> bool
pub fn remove_section(&mut self, name: &str) -> bool
Removes a section with the specified name.
sourcepub fn set_value(&mut self, section: &str, key: &str, value: &str)
pub fn set_value(&mut self, section: &str, key: &str, value: &str)
Sets the value of a key in a section.
sourcepub fn remove_key(&mut self, section: &str, key: &str) -> bool
pub fn remove_key(&mut self, section: &str, key: &str) -> bool
Removes a key with the specified name.
sourcepub fn add_comment(&mut self, section: &str, comment: &str)
pub fn add_comment(&mut self, section: &str, comment: &str)
Adds a comment to a section.
sourcepub fn get_value(&self, section: &str, key: &str) -> Option<String>
pub fn get_value(&self, section: &str, key: &str) -> Option<String>
Gets a value from a section.
sourcepub fn merge_from(&mut self, source: &Config)
pub fn merge_from(&mut self, source: &Config)
Merge in sections from a different config.
sourcepub fn sections<'l>(&'l self) -> ConfigSection<'l>ⓘ
pub fn sections<'l>(&'l self) -> ConfigSection<'l>ⓘ
Returns an iterator over all the sections in the config. The first returned section will typically be the root section, even if it’s empty.
sourcepub fn keys<'l>(&'l self, section: &str) -> ConfigEntry<'l>ⓘ
pub fn keys<'l>(&'l self, section: &str) -> ConfigEntry<'l>ⓘ
Returns an iterator over all the entries in a particular section.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more