pub enum Repr {
Unit,
Bool(bool),
Int(i64),
Float(u64),
Str(String),
List(Vec<Repr>),
Map(Vec<(Repr, Repr)>),
Data {
ty: String,
variant: Option<String>,
fields: Vec<(String, Repr)>,
},
}Expand description
A Value restricted to what may be stored, as a concrete type a non-self-describing codec can
encode.
The variants are exactly crate::core::value_to_repr’s cases, minus the three it refuses.
Variants§
Unit
Bool(bool)
Int(i64)
Float(u64)
The bit pattern, as Value stores it — so that a round trip is exact for NaN and for
negative zero, which a decimal rendering is not.
Str(String)
List(Vec<Repr>)
Map(Vec<(Repr, Repr)>)
Pairs rather than a map, because the key is a Repr and most map encodings insist on
strings. Order is the PMap’s, which is sorted, so the encoding is canonical.
Data
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Repr
impl<'de> Deserialize<'de> for Repr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Repr
Auto Trait Implementations§
impl Freeze for Repr
impl RefUnwindSafe for Repr
impl Send for Repr
impl Sync for Repr
impl Unpin for Repr
impl UnwindSafe for Repr
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