[−][src]Struct librustconfig::config::OptionWriter
Writer for configuration option.
Implementations
impl OptionWriter
[src]
pub fn delete(&self) -> Result<(), Errors>
[src]
Delete current config element.
Example
use librustconfig::config::Config; let cfg = Config::new(); match cfg.create_section("group") { Some(group) => { /* ... */ if !group.delete().is_ok() { /* ... */ } }, None => { /* ... */ } }
pub fn create_section<S>(&self, path: S) -> Option<OptionWriter> where
S: Into<String>,
[src]
S: Into<String>,
Create new group section.
Examples
use librustconfig::config::Config; let cfg = Config::new(); match cfg.create_section("root.group") { Some(s) => { /* ... */ }, None => { /* ... */ } }
pub fn create_array<S>(&self, path: S) -> Option<CollectionWriter> where
S: Into<String>,
[src]
S: Into<String>,
Create new array group section.
Examples
use librustconfig::config::Config; let cfg = Config::new(); let group = cfg.create_section("group").unwrap(); match group.create_array("array") { Some(s) => { /* ... */ }, None => { /* ... */ } }
pub fn create_list<S>(&self, path: S) -> Option<CollectionWriter> where
S: Into<String>,
[src]
S: Into<String>,
Create new list group section.
Examples
use librustconfig::config::Config; let cfg = Config::new(); let group = cfg.create_section("group").unwrap(); match group.create_list("root.list") { Some(s) => { /* ... */ }, None => { /* ... */ } }
pub fn write_int32<S>(&self, name: S, value: i32) -> Option<OptionWriter> where
S: Into<String>,
[src]
S: Into<String>,
Add new integer value to current group.
Example
use librustconfig::config::Config; let cfg = Config::new(); match cfg.create_section("section") { Some(s) => { s.write_int32("ival", 321); }, None => { /* ... */ } }
pub fn write_int64<S>(&self, name: S, value: i64) -> Option<OptionWriter> where
S: Into<String>,
[src]
S: Into<String>,
Add new int64 value to current group.
Example
use librustconfig::config::Config; let cfg = Config::new(); match cfg.create_section("section") { Some(s) => { s.write_int64("ival", 321000); }, None => { /* ... */ } }
pub fn write_float64<S>(&self, name: S, value: f64) -> Option<OptionWriter> where
S: Into<String>,
[src]
S: Into<String>,
Add new float value to current group.
Example
use librustconfig::config::Config; let cfg = Config::new(); match cfg.create_section("section") { Some(s) => { s.write_float64("ival", 321.001); }, None => { /* ... */ } }
pub fn write_bool<S>(&self, name: S, value: bool) -> Option<OptionWriter> where
S: Into<String>,
[src]
S: Into<String>,
Add new boolean value to current group.
Example
use librustconfig::config::Config; let cfg = Config::new(); match cfg.create_section("section") { Some(s) => { s.write_bool("ival", false); }, None => { /* ... */ } }
pub fn write_string<S>(&self, name: S, value: S) -> Option<OptionWriter> where
S: Into<String>,
[src]
S: Into<String>,
Add new string value to current group.
Example
use librustconfig::config::Config; let cfg = Config::new(); match cfg.create_section("section") { Some(s) => { s.write_string("ival", "test string"); }, None => { /* ... */ } }
Trait Implementations
impl Clone for OptionWriter
[src]
fn clone(&self) -> OptionWriter
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for OptionWriter
[src]
Auto Trait Implementations
impl RefUnwindSafe for OptionWriter
impl !Send for OptionWriter
impl !Sync for OptionWriter
impl Unpin for OptionWriter
impl UnwindSafe for OptionWriter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,