pub enum Value<'src> {
None,
Integer(i64),
Decimal(f64),
Boolean(bool),
Date(Date),
String(Cow<'src, str>),
Identifier(Cow<'src, str>),
Object(ObjectMap<'src>),
Array(Vec<Value<'src>>),
}
Expand description
A variant that represents a Clausewitz source file as a tree of types and values. from_reader and from_str can be used to deserialize a Clausewitz source file into a Value tree.
Using Value to deserialize is slower and uses more memory than using Deserializer. Unlike Deserializer, Value allocates values on the heap (though strings are not copied). It also makes no guarantees about the validity of the data, as long as it’s parseable.
You should only use Value for situations where the schema of the data can’t be known beforehand.
Variants§
None
Integer(i64)
Decimal(f64)
Boolean(bool)
Date(Date)
String(Cow<'src, str>)
Identifier(Cow<'src, str>)
Object(ObjectMap<'src>)
Array(Vec<Value<'src>>)
Implementations§
Trait Implementations§
Source§impl<'src> PartialOrd for Value<'src>
impl<'src> PartialOrd for Value<'src>
impl<'src> StructuralPartialEq for Value<'src>
Auto Trait Implementations§
impl<'src> Freeze for Value<'src>
impl<'src> RefUnwindSafe for Value<'src>
impl<'src> Send for Value<'src>
impl<'src> Sync for Value<'src>
impl<'src> Unpin for Value<'src>
impl<'src> UnwindSafe for Value<'src>
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