pub struct ConfigReader { /* private fields */ }Expand description
Reads key=value configuration from text.
Implementations§
Source§impl ConfigReader
impl ConfigReader
pub fn new() -> Self
pub fn parse(text: &str) -> Self
pub fn get(&self, key: &str) -> Option<&str>
pub fn get_or(&self, key: &str, default: &str) -> String
pub fn get_int(&self, key: &str) -> Option<i64>
pub fn get_float(&self, key: &str) -> Option<f64>
pub fn get_bool(&self, key: &str) -> Option<bool>
pub fn contains(&self, key: &str) -> bool
pub fn count(&self) -> usize
pub fn sections(&self) -> &[String]
pub fn keys_in_section(&self, section: &str) -> Vec<String>
pub fn all_keys(&self) -> Vec<&str>
pub fn set(&mut self, key: &str, value: &str)
Trait Implementations§
Source§impl Clone for ConfigReader
impl Clone for ConfigReader
Source§fn clone(&self) -> ConfigReader
fn clone(&self) -> ConfigReader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigReader
impl Debug for ConfigReader
Auto Trait Implementations§
impl Freeze for ConfigReader
impl RefUnwindSafe for ConfigReader
impl Send for ConfigReader
impl Sync for ConfigReader
impl Unpin for ConfigReader
impl UnsafeUnpin for ConfigReader
impl UnwindSafe for ConfigReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more