pub struct TomlConfig<'a> {
entries: Vec<(&'a str, &'a str, ConfigValue<'a>)>,
}Expand description
Parsed TOML configuration: flat (section, key, value) triples kept
sorted for O(log n) binary-search lookups with minimal memory overhead.
Fields§
§entries: Vec<(&'a str, &'a str, ConfigValue<'a>)>Implementations§
Source§impl<'a> TomlConfig<'a>
impl<'a> TomlConfig<'a>
fn lookup(&self, section: &str, key: &str) -> Option<&ConfigValue<'a>>
pub fn get_int(&self, section: &str, key: &str) -> Option<i64>
pub fn get_bool(&self, section: &str, key: &str) -> Option<bool>
pub fn get_str(&self, section: &str, key: &str) -> Option<&str>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<'a> Clone for TomlConfig<'a>
impl<'a> Clone for TomlConfig<'a>
Source§fn clone(&self) -> TomlConfig<'a>
fn clone(&self) -> TomlConfig<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for TomlConfig<'a>
impl<'a> RefUnwindSafe for TomlConfig<'a>
impl<'a> Send for TomlConfig<'a>
impl<'a> Sync for TomlConfig<'a>
impl<'a> Unpin for TomlConfig<'a>
impl<'a> UnsafeUnpin for TomlConfig<'a>
impl<'a> UnwindSafe for TomlConfig<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more