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

pub struct Ini { /* fields omitted */ }

Ini struct

Methods

impl Ini[src]

pub fn new() -> Ini[src]

Create an instance

pub fn with_section<S>(&mut self, section: Option<S>) -> SectionSetter where
    S: Into<String>, 
[src]

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

pub fn general_section(&self) -> &Properties[src]

Get the immmutable general section

pub fn general_section_mut(&mut self) -> &mut Properties[src]

Get the mutable general section

pub fn section<S>(&self, name: Option<S>) -> Option<&Properties> where
    S: Into<String>, 
[src]

Get a immutable section

pub fn section_mut<S>(&mut self, name: Option<S>) -> Option<&mut Properties> where
    S: Into<String>, 
[src]

Get a mutable section

pub fn entry(
    &mut self,
    name: Option<String>
) -> Entry<Option<String>, Properties>
[src]

Get the entry

pub fn clear(&mut self)[src]

Clear all entries

pub fn sections(&self) -> Keys<Option<String>, Properties>[src]

Iterate with sections

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

Set key-value to a section

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

Get the value from a section with key

Example:

use pacman::ini::Ini;
let input = "[sec]\nabc = def\n";
let ini = Ini::load_from_str(input).unwrap();

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

Delete a section, return the properties if it exists

impl Ini[src]

pub fn load_from_str(buf: &str) -> Result<Ini, ParseError>[src]

Load from a string

pub fn load_from_str_noescape(buf: &str) -> Result<Ini, ParseError>[src]

Load from a string, but do not interpret '' as an escape character

pub fn load_from_str_opt(buf: &str, opt: ParseOption) -> Result<Ini, ParseError>[src]

Load from a string with options

pub fn read_from<R: Read>(reader: &mut R) -> Result<Ini, Error>[src]

Load from a reader

pub fn read_from_noescape<R: Read>(reader: &mut R) -> Result<Ini, Error>[src]

Load from a reader, but do not interpret '' as an escape character

pub fn read_from_opt<R: Read>(
    reader: &mut R,
    opt: ParseOption
) -> Result<Ini, Error>
[src]

Load from a reader with options

pub fn load_from_file<P: AsRef<Path>>(filename: P) -> Result<Ini, Error>[src]

Load from a file

pub fn load_from_file_noescape<P: AsRef<Path>>(
    filename: P
) -> Result<Ini, Error>
[src]

Load from a file, but do not interpret '' as an escape character

pub fn load_from_file_opt<P: AsRef<Path>>(
    filename: P,
    opt: ParseOption
) -> Result<Ini, Error>
[src]

Load from a file with options

impl<'a> Ini[src]

Important traits for SectionIterator<'a>
pub fn iter(&'a self) -> SectionIterator<'a>[src]

Immutable iterate though sections

Important traits for SectionMutIterator<'a>
pub fn mut_iter(&'a mut self) -> SectionMutIterator<'a>[src]

Mutable iterate though sections Deprecated! Use iter_mut instead!

Important traits for SectionMutIterator<'a>
pub fn iter_mut(&'a mut self) -> SectionMutIterator<'a>[src]

Mutable iterate though sections

Trait Implementations

impl Clone for Ini[src]

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

Performs copy-assignment from source. Read more

impl<'a> IntoIterator for &'a Ini[src]

type Item = (&'a Option<String>, &'a Properties)

The type of the elements being iterated over.

type IntoIter = SectionIterator<'a>

Which kind of iterator are we turning this into?

impl<'a> IntoIterator for &'a mut Ini[src]

type Item = (&'a Option<String>, &'a mut Properties)

The type of the elements being iterated over.

type IntoIter = SectionMutIterator<'a>

Which kind of iterator are we turning this into?

impl IntoIterator for Ini[src]

type Item = (Option<String>, Properties)

The type of the elements being iterated over.

type IntoIter = SectionIntoIter

Which kind of iterator are we turning this into?

impl Default for Ini[src]

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

type Output = Properties

The returned type after indexing.

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

type Output = Properties

The returned type after indexing.

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

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

Auto Trait Implementations

impl Send for Ini

impl Sync for Ini

Blanket Implementations

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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

type Owned = T

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

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.