pub enum Value {
Unknown,
String(String),
Double(OrderedFloat<f64>),
Bool(bool),
Long(i64),
UnsignedLong(u64),
Duration(Duration),
Base64Binary(Vec<u8>),
TimeRFC(DateTime<FixedOffset>),
}
Expand description
Represents primitive types that are supported for conversion into a BTreeMap that can support
heterogeneous values. Inspired by serde_json::Value
s.
Variants§
Unknown
String(String)
Double(OrderedFloat<f64>)
Bool(bool)
Long(i64)
UnsignedLong(u64)
Duration(Duration)
Base64Binary(Vec<u8>)
TimeRFC(DateTime<FixedOffset>)
Implementations§
Source§impl Value
impl Value
Sourcepub fn new<T: Any>(value: T) -> Value
pub fn new<T: Any>(value: T) -> Value
Given a genericized input type, encapsulate it as a Value that can be used in a map container type when converting to and from a struct.
pub fn downcast<T>(&self) -> Option<T>
pub fn bool(&self) -> Option<bool>
pub fn i64(&self) -> Option<i64>
pub fn u64(&self) -> Option<u64>
pub fn f64(&self) -> Option<f64>
pub fn string(&self) -> Option<String>
Trait Implementations§
impl Eq for Value
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