[−][src]Struct librustconfig::config::CollectionWriter
Writer for collection (array, list) option.
Implementations
impl CollectionWriter
[src]
pub fn write_int32(&self, value: i32) -> Option<CollectionWriter>
[src]
Add new integer value to current collection.
Example
use librustconfig::config::Config; let cfg = Config::new(); let group = cfg.create_section("group").unwrap(); match group.create_array("int32_collection") { Some(s) => { s.write_int32(321); s.write_int32(-12); }, None => { /* ... */ } }
pub fn write_int64(&self, value: i64) -> Option<CollectionWriter>
[src]
Add new int64 value to current collection.
Example
use librustconfig::config::Config; let cfg = Config::new(); let group = cfg.create_section("group").unwrap(); match group.create_array("int64_collection") { Some(s) => { s.write_int64(321000); }, None => { /* ... */ } }
pub fn write_float64(&self, value: f64) -> Option<CollectionWriter>
[src]
Add new float value to current collection.
Example
use librustconfig::config::Config; let cfg = Config::new(); let group = cfg.create_section("group").unwrap(); match group.create_array("float_collection") { Some(s) => { s.write_float64(321.001); }, None => { /* ... */ } }
pub fn write_bool(&self, value: bool) -> Option<CollectionWriter>
[src]
Add new boolean value to current collection.
Example
use librustconfig::config::Config; let cfg = Config::new(); let group = cfg.create_section("group").unwrap(); match group.create_array("bool_collection") { Some(s) => { s.write_bool(false); }, None => { /* ... */ } }
pub fn write_string<S>(&self, value: S) -> Option<CollectionWriter> where
S: Into<String>,
[src]
S: Into<String>,
Add new string value to current collection.
Example
use librustconfig::config::Config; let cfg = Config::new(); let group = cfg.create_section("group").unwrap(); match group.create_array("str_collection") { Some(s) => { s.write_string("test string"); }, None => { /* ... */ } }
Trait Implementations
impl Clone for CollectionWriter
[src]
fn clone(&self) -> CollectionWriter
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for CollectionWriter
[src]
Auto Trait Implementations
impl RefUnwindSafe for CollectionWriter
impl !Send for CollectionWriter
impl !Sync for CollectionWriter
impl Unpin for CollectionWriter
impl UnwindSafe for CollectionWriter
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>,