pub enum Value {
String(String),
Int(i64),
Float(f64),
Bool(bool),
Array(Vec<Value>),
}Expand description
A value that can be stored in a YINI file.
Values can be strings, integers, floats, booleans, or arrays of values. This enum provides type checking and conversion methods similar to the C++ variant.
Variants§
String(String)
A string value.
Int(i64)
An integer value.
Float(f64)
A floating-point value.
Bool(bool)
A boolean value.
Array(Vec<Value>)
An array of values.
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_string(&self) -> Result<String>
pub fn as_string(&self) -> Result<String>
Convert this value to a string.
All value types can be converted to strings:
- Strings remain as-is
- Numbers are formatted
- Booleans become “true” or “false”
- Arrays cannot be converted and will return an error
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