Struct ini::ini::Ini [] [src]

pub struct Ini {
    // some fields omitted
}

Ini struct

Methods

impl Ini
[src]

fn new() -> Ini

Create an instance

fn with_section<'b, S>(&'b mut self, section: Option<S>) -> SectionSetter<'b> where S: Into<String>

Set with a specified section, None is for the general section

fn general_section(&self) -> &Properties

Get the immmutable general section

fn general_section_mut(&mut self) -> &mut Properties

Get the mutable general section

fn section<'a, S>(&'a self, name: Option<S>) -> Option<&'a Properties> where S: Into<String>

Get a immutable section

fn section_mut<'a, S>(&'a mut self, name: Option<S>) -> Option<&'a mut Properties> where S: Into<String>

Get a mutable section

fn entry<'a>(&'a mut self, name: Option<String>) -> Entry<Option<String>, Properties>

Get the entry

fn clear<'a>(&mut self)

Clear all entries

fn sections<'a>(&'a self) -> Keys<'a, Option<String>, Properties>

Iterate with sections

fn set_to<S>(&mut self, section: Option<S>, key: String, value: String) where S: Into<String>

Set key-value to a section

fn get_from<'a, S>(&'a self, section: Option<S>, key: &str) -> Option<&'a str> where S: Into<String>

Get the value from a section with key

fn get_from_or<'a, S>(&'a self, section: Option<S>, key: &str, default: &'a str) -> &'a str where S: Into<String>

Get the value from a section with key, return the default value if it does not exists

fn get_from_mut<'a, S>(&'a mut self, section: Option<S>, key: &str) -> Option<&'a str> where S: Into<String>

Get the mutable from a section with key

fn delete<S>(&mut self, section: Option<S>) -> Option<Properties> where S: Into<String>

Delete a section, return the properties if it exists

fn delete_from<S>(&mut self, section: Option<S>, key: &str) -> Option<String> where S: Into<String>

impl Ini
[src]

fn write_to_file(&self, filename: &str) -> Result<()>

Write to a file

fn write_to_file_policy(&self, filename: &str, policy: EscapePolicy) -> Result<()>

Write to a file

fn write_to<W: Write>(&self, writer: &mut W) -> Result<()>

Write to a writer

fn write_to_policy<W: Write>(&self, writer: &mut W, policy: EscapePolicy) -> Result<()>

Write to a writer

impl Ini
[src]

fn load_from_str(buf: &str) -> Result<IniError>

Load from a string

fn read_from<R: Read>(reader: &mut R) -> Result<IniError>

Load from a reader

fn load_from_file(filename: &str) -> Result<IniError>

Load from a file

impl<'a> Ini
[src]

fn iter(&'a self) -> SectionIterator<'a>

Immutable iterate though sections

fn mut_iter(&'a mut self) -> SectionMutIterator<'a>

Mutable iterate though sections

Trait Implementations

impl Clone for Ini
[src]

fn clone(&self) -> Ini

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<'q> Index<&'q Option<String>> for Ini
[src]

type Output = Properties

The returned type after indexing

fn index<'a>(&'a self, index: &'q Option<String>) -> &'a Properties

The method for the indexing (Foo[Bar]) operation

impl<'i> IndexMut<&'i Option<String>> for Ini
[src]

fn index_mut<'a>(&'a mut self, index: &Option<String>) -> &'a mut Properties

The method for the indexing (Foo[Bar]) operation

impl<'q> Index<&'q str> for Ini
[src]

type Output = Properties

The returned type after indexing

fn index<'a>(&'a self, index: &'q str) -> &'a Properties

The method for the indexing (Foo[Bar]) operation

impl<'q> IndexMut<&'q str> for Ini
[src]

fn index_mut<'a>(&'a mut self, index: &'q str) -> &'a mut Properties

The method for the indexing (Foo[Bar]) operation