pub enum Value {
None,
Array(Vec<Value>),
Table(IndexMap<String, Value>),
String(String),
Float(f64),
Int(i64),
Bool(bool),
}Expand description
A type that represents a value in a configuration file.
Variants§
None
Array(Vec<Value>)
Table(IndexMap<String, Value>)
String(String)
Float(f64)
Int(i64)
Bool(bool)
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_table(&self) -> Option<&IndexMap<String, Value>>
pub fn as_table(&self) -> Option<&IndexMap<String, Value>>
Gets a reference to the value associated with the given key in a table.
Sourcepub fn as_table_mut(&mut self) -> Option<&mut IndexMap<String, Value>>
pub fn as_table_mut(&mut self) -> Option<&mut IndexMap<String, Value>>
Gets a mutable reference to the value associated with the given key in a table.
Sourcepub fn as_array(&self) -> Option<&Vec<Value>>
pub fn as_array(&self) -> Option<&Vec<Value>>
Gets a reference to the value associated with the given key in a table.
Sourcepub fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>
pub fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>
Gets a mutable reference to the value associated with the given key in a table.
Sourcepub fn get(&self, key: &str) -> Option<&Value>
pub fn get(&self, key: &str) -> Option<&Value>
Gets a reference to the value associated with the given key in a table.
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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