pub enum Value {
Null,
Bool(bool),
Int(Int),
Float(f64),
String(String),
Array(Vec<Value>),
Object(BTreeMap<String, Value>),
IntTooWide,
}Variants§
Null
Bool(bool)
Int(Int)
Float(f64)
String(String)
Array(Vec<Value>)
Object(BTreeMap<String, Value>)
IntTooWide
An integer too wide for Int, kept as a fact so validation can report
it at its own path instead of the parse failing the whole document.
Trait Implementations§
Source§impl Input for Value
impl Input for Value
Source§type Child<'a> = &'a Value
type Child<'a> = &'a Value
An element of an array, or the value at a key.
Implementations should make this converge, usually to themselves or to a
reference to themselves. A type whose child is a strictly new type on
every level would make the validator recurse forever at compile time.
fn kind(&self) -> Kind
fn as_bool(&self) -> Option<bool>
fn as_int(&self) -> Option<Int>
fn as_f64(&self) -> Option<f64>
fn as_str(&self) -> Option<Cow<'_, str>>
fn item(&self, index: usize) -> Option<&Value>
Source§fn each_key(&self, f: &mut dyn FnMut(&str))
fn each_key(&self, f: &mut dyn FnMut(&str))
Visits every key of an object, for the unknown-field check.
fn is_empty(&self) -> bool
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 UnsafeUnpin 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