Struct allegro::config::Config[][src]

pub struct Config { /* fields omitted */ }

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]

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]

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

impl RefUnwindSafe for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.