[][src]Struct mininip::datas::tree::Tree

pub struct Tree { /* fields omitted */ }

A more user-friendly data-type to represent the data returned by parser::Parser::data

Example

use mininip::datas{Identifier, Value, self};
use datas::tree::Tree;
use mininip::parse::parse_file;
 
let tree = Tree::from_data(parse_file("good.ini").unwrap());
for i in tree.sections() {
    println!("[{}] ; Section {}", i, i);
    for j in i.keys() {
        println!("{}={} ; key {}", j.ident().name(), j.value(), j.ident().name());
    }
}

Methods

impl Tree[src]

pub fn sections(&self) -> SectionIterator[src]

Iterates over the sections of a Tree

pub fn get_data(&self) -> &HashMap<Identifier, Value>[src]

Returns an immutable reference to the owned data

pub fn into_data(self) -> HashMap<Identifier, Value>[src]

Consumes self and returns the owned data

Trait Implementations

impl From<HashMap<Identifier, Value, RandomState>> for Tree[src]

Auto Trait Implementations

impl RefUnwindSafe for Tree

impl Send for Tree

impl Sync for Tree

impl Unpin for Tree

impl UnwindSafe for Tree

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, 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.