[−][src]Struct confindent::Confindent
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 get_child<T: Into<String>>(&self, key: T) -> Option<&ConfSection>
[src]
fn get_child_mut<T: Into<String>>(&mut self, key: T) -> Option<&mut ConfSection>
[src]
fn create_child<T: Into<String>>(&mut self, key: T, value: T) -> &mut Self
[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]
fn eq(&self, other: &Confindent) -> bool
[src]
fn ne(&self, other: &Confindent) -> bool
[src]
impl Debug for Confindent
[src]
impl FromStr for Confindent
[src]
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]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,