Struct allegro::config::Config [−][src]
Allegro configuration.
Wraps ALLEGRO_CONFIG.
Implementations
impl Config
[src]
pub fn new() -> Config
[src]
Creates an empty configuration.
pub unsafe fn wrap(config: *mut ALLEGRO_CONFIG, own: bool) -> Config
[src]
pub fn load(path: &str) -> Result<Config, ()>
[src]
Loads a config from a path.
pub fn merge(cfg1: &Config, cfg2: &Config) -> Config
[src]
Merge two configs into 1.
pub fn get_allegro_config(&self) -> *mut ALLEGRO_CONFIG
[src]
Returns the wrapped ALLEGRO_CONFIG.
pub fn save(&self, path: &str) -> Result<(), ()>
[src]
Loads a config from a path.
pub fn add_section(&mut self, name: &str)
[src]
Adds an empty section with the specified name.
pub fn remove_section(&mut self, name: &str) -> bool
[src]
Removes a section with the specified name.
pub fn set_value(&mut self, section: &str, key: &str, value: &str)
[src]
Sets the value of a key in a section.
pub fn remove_key(&mut self, section: &str, key: &str) -> bool
[src]
Removes a key with the specified name.
pub fn add_comment(&mut self, section: &str, comment: &str)
[src]
Adds a comment to a section.
pub fn get_value(&self, section: &str, key: &str) -> Option<String>
[src]
Gets a value from a section.
pub fn merge_from(&mut self, source: &Config)
[src]
Merge in sections from a different config.
pub fn sections<'l>(&'l self) -> ConfigSection<'l>ⓘNotable traits for ConfigSection<'l>
impl<'l> Iterator for ConfigSection<'l> type Item = String;
[src]
Notable traits for ConfigSection<'l>
impl<'l> Iterator for ConfigSection<'l> type Item = String;
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.
pub fn keys<'l>(&'l self, section: &str) -> ConfigEntry<'l>ⓘNotable traits for ConfigEntry<'l>
impl<'l> Iterator for ConfigEntry<'l> type Item = String;
[src]
Notable traits for ConfigEntry<'l>
impl<'l> Iterator for ConfigEntry<'l> type Item = String;
Returns an iterator over all the entries in a particular section.
Trait Implementations
impl Clone for Config
[src]
impl Drop for Config
[src]
impl Send for Config
[src]
impl Sync for Config
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,