[][src]Struct confindent::Confindent

pub struct Confindent { /* fields omitted */ }

Structure for Reading/Writing configuration

Methods

impl Confindent[src]

pub fn new() -> Self[src]

Create an empty configuration

pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Creates a new configuration from a file

Examples

use confindent::Confindent;

let conf = Confindent::from_file("./examples/example.conf");

pub fn to_file<P: AsRef<Path>>(self, path: P) -> Result<()>[src]

Writes configurtion to a file

Examples

use confindent::{Confindent, ConfParent};

let mut conf = Confindent::new();
conf.create("Section", "Value");
conf.child_mut("Section")
    .unwrap()
    .create("SubSection", "Value")
    .create("SubSection", "Value");

conf.to_file("example.conf").unwrap();

Trait Implementations

impl ConfParent for Confindent[src]

fn child<T: Into<String>>(&self, key: T) -> Option<&ConfSection>[src]

Shorthand for get_child()

fn child_mut<T: Into<String>>(&mut self, key: T) -> Option<&mut ConfSection>[src]

Shorthand for get_child_mut()

fn create<T: Into<String>>(&mut self, key: T, value: T) -> &mut Self[src]

Shorthand for create_child()

fn get_child_value<T: Into<String>, Y: FromStr>(&self, key: T) -> Option<Y>[src]

Get the value of a child Read more

fn child_value<T: Into<String>, Y: FromStr>(&self, key: T) -> Option<Y>[src]

Shorthand for get_child_value()

impl Into<String> for Confindent[src]

impl PartialEq<Confindent> for Confindent[src]

impl Debug for Confindent[src]

impl FromStr for Confindent[src]

type Err = ParseError

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Send for Confindent

impl Sync for Confindent

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<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.