Enum generic_json::Value [−][src]
pub enum Value<T: Json> {
Null,
Boolean(bool),
Number(T::Number),
String(T::String),
Array(T::Array),
Object(T::Object),
}
Expand description
Any JSON value.
Variants
JSON null
value.
Boolean(bool)
JSON boolean value (true
or false
).
Tuple Fields of Boolean
0: bool
Number(T::Number)
JSON number, wether integer of floating point.
Tuple Fields of Number
0: T::Number
String(T::String)
JSON string value.
Tuple Fields of String
0: T::String
Array(T::Array)
JSON array of values.
Tuple Fields of Array
0: T::Array
Object(T::Object)
JSON object.
Tuple Fields of Object
0: T::Object
Implementations
Returns true
if the value is a boolean. Returns false
otherwise.
For any value on which is_bool
returns true
,
as_bool
is guaranteed to return the boolean value.
Returns true
if the value is a number. Returns false
otherwise.
For any value on which is_number
returns true
,
as_number
is guaranteed to return the number value.
Returns true
if the value is a string.
Returns false
otherwise.
For any value on which is_string
returns true
,
as_str
is guaranteed to return the string value.
Returns true
if the value is an array.
Returns false
otherwise.
For any value on which is_array
returns true
,
as_array
is guaranteed to return the array value.
Returns true
if the value is an object.
Returns false
otherwise.
For any value on which is_object
returns true
,
as_object
is guaranteed to return the object value.
If the value is a boolean, returns the associated bool
.
Returns None
otherwise.
If the value is a number, returns a reference to it.
Returns None
otherwise.
If the value is a string, returns its associated str
.
Returns None
otherwise.
If the value is an array, returns a reference to it.
Returns None
otherwise.
If the value is an array, returns a mutable reference to it.
Returns None
otherwise.
If the value is an object, returns a reference to it.
Returns None
otherwise.
If the value is an object, returns a mutable reference to it.
Returns None
otherwise.
Trait Implementations
Creates a value from an iterator. Read more
impl<T: Json, U: Json> PartialOrd<Value<U>> for Value<T> where
T::Number: PartialOrd<U::Number>,
T::String: PartialOrd<U::String>,
T::Array: PartialOrd<U::Array>,
T::Object: PartialOrd<U::Object>,
impl<T: Json, U: Json> PartialOrd<Value<U>> for Value<T> where
T::Number: PartialOrd<U::Number>,
T::String: PartialOrd<U::String>,
T::Array: PartialOrd<U::Array>,
T::Object: PartialOrd<U::Object>,
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Value<T> where
<T as Json>::Array: RefUnwindSafe,
<T as Json>::Number: RefUnwindSafe,
<T as Json>::Object: RefUnwindSafe,
<T as Json>::String: RefUnwindSafe,
impl<T> Send for Value<T> where
<T as Json>::Array: Send,
<T as Json>::Number: Send,
<T as Json>::Object: Send,
<T as Json>::String: Send,
impl<T> Sync for Value<T> where
<T as Json>::Array: Sync,
<T as Json>::Number: Sync,
<T as Json>::Object: Sync,
<T as Json>::String: Sync,
impl<T> Unpin for Value<T> where
<T as Json>::Array: Unpin,
<T as Json>::Number: Unpin,
<T as Json>::Object: Unpin,
<T as Json>::String: Unpin,
impl<T> UnwindSafe for Value<T> where
<T as Json>::Array: UnwindSafe,
<T as Json>::Number: UnwindSafe,
<T as Json>::Object: UnwindSafe,
<T as Json>::String: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more