pub enum Value {
Null,
Bool(bool),
Integer(i128),
Float(FloatOrd<f64>),
Bytes(Vec<u8>),
Text(String),
Array(Vec<Value>),
Map(BTreeMap<Value, Value>),
}Expand description
Value represents all the types of data we can validate.
To validate a new type of data, write implementations of the From
trait for that type. See the cbor module for an example.
Variants§
Null
Bool(bool)
Integer(i128)
Float(FloatOrd<f64>)
Bytes(Vec<u8>)
Text(String)
Array(Vec<Value>)
Map(BTreeMap<Value, Value>)
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
Source§impl PartialOrd for Value
impl PartialOrd for Value
impl StructuralPartialEq for Value
Source§impl TryFrom<&Value> for Value
impl TryFrom<&Value> for Value
Source§type Error = ValidateError
type Error = ValidateError
The type returned in the event of a conversion error.
Source§impl TryFrom<&Value> for Value
impl TryFrom<&Value> for Value
Source§type Error = ValidateError
type Error = ValidateError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Forget for Value
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