pub enum Value {
}Expand description
Lossless, self-describing dynamic value supporting all COI / MMDB types.
Variants§
Null
Bool(bool)
U8(u8)
U16(u16)
U32(u32)
U64(u64)
U128(u128)
I32(i32)
I64(i64)
F32(f32)
F64(f64)
Utf8(String)
Bytes(Vec<u8>)
Array(Vec<Value>)
Map(BTreeMap<String, Value>)
Implementations§
Source§impl Value
impl Value
Sourcepub fn bit_eq(&self, other: &Self) -> bool
pub fn bit_eq(&self, other: &Self) -> bool
Strict bit-exact equality (preserves exact numeric type and IEEE-754 float bits).
pub fn as_map(&self) -> Option<&BTreeMap<String, Value>>
pub fn as_array(&self) -> Option<&[Value]>
pub fn as_str(&self) -> Option<&str>
Sourcepub fn bit_cmp(&self, other: &Self) -> Ordering
pub fn bit_cmp(&self, other: &Self) -> Ordering
Deterministic total ordering over canonical Values (using IEEE-754 bit patterns for floats).
pub fn bit_hash<H: Hasher>(&self, state: &mut H)
Sourcepub fn encode(&self, out: &mut Vec<u8>)
pub fn encode(&self, out: &mut Vec<u8>)
Encode this Value into canonical COI Dynamic wire bytes.
Sourcepub fn decode(c: &mut Cursor<'_>) -> Result<Self, FormatError>
pub fn decode(c: &mut Cursor<'_>) -> Result<Self, FormatError>
Decode a canonical COI Dynamic Value from a cursor.
pub fn decode_exact(buf: &[u8]) -> Result<Self, FormatError>
Trait Implementations§
impl Eq for Value
Source§impl Ord for Value
impl Ord for Value
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Auto Trait Implementations§
impl Forget for Value
impl Freeze for Valuewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Valuewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
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