pub enum Toml {
Str(String),
Bool(bool),
Num(f64),
Date(String),
Array(Vec<HashMap<String, Toml>>),
SimpleArray(Vec<Toml>),
}
Expand description
A TOML value.
Variants§
Str(String)
Bool(bool)
Num(f64)
Date(String)
Array(Vec<HashMap<String, Toml>>)
SimpleArray(Vec<Toml>)
Implementations§
source§impl Toml
impl Toml
sourcepub fn num(&self) -> f64
pub fn num(&self) -> f64
Get the TOML value as a float
Panics if the TOML value isn’t actually a float
sourcepub fn str(&self) -> &str
pub fn str(&self) -> &str
Get the TOML value as a string
Panics if the TOML value isn’t actually a string
sourcepub fn boolean(&self) -> bool
pub fn boolean(&self) -> bool
Get the TOML value as a boolean
Panics if the TOML value isn’t actually a boolean
sourcepub fn date(&self) -> String
pub fn date(&self) -> String
Get the TOML value as a date string
Panics if the TOML value isn’t actually a date string. See the spec for what “date string” means.
sourcepub fn arr(&self) -> &Vec<HashMap<String, Toml>>
pub fn arr(&self) -> &Vec<HashMap<String, Toml>>
Get the TOML value as a table
Panics if the TOML value isn’t actually a table
sourcepub fn simple_arr(&self) -> &Vec<Toml>
pub fn simple_arr(&self) -> &Vec<Toml>
Get the TOML value as an array
Panics if the TOML value isn’t actually an array
Trait Implementations§
source§impl PartialEq for Toml
impl PartialEq for Toml
impl StructuralPartialEq for Toml
Auto Trait Implementations§
impl RefUnwindSafe for Toml
impl Send for Toml
impl Sync for Toml
impl Unpin for Toml
impl UnwindSafe for Toml
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