Enum generic_json::ValueRef [−][src]
pub enum ValueRef<'a, T: Json> {
Null,
Boolean(bool),
Number(&'a T::Number),
String(&'a T::String),
Array(&'a T::Array),
Object(&'a T::Object),
}Expand description
JSON value reference.
Variants
Boolean(bool)Tuple Fields of Boolean
0: boolNumber(&'a T::Number)Tuple Fields of Number
0: &'a T::NumberString(&'a T::String)Tuple Fields of String
0: &'a T::StringArray(&'a T::Array)Tuple Fields of Array
0: &'a T::ArrayObject(&'a T::Object)Tuple Fields of Object
0: &'a T::ObjectImplementations
Returns true if the value is a boolean. Returns false otherwise.
For any value on which is_boolean 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 this number as an u32 if it can be exactly represented as such.
Returns this number as an u64 if it can be exactly represented as such.
Returns this number as an i32 if it can be exactly represented as such.
Returns this number as an i64 if it can be exactly represented as such.
Returns this number as an f32 if it can be exactly represented as such.
Returns this number as an f32 if it is a number, potentially losing precision in the process.
Returns this number as an f64 if it can be exactly represented as such.
Returns this number as an f64 if it is a number, potentially losing precision in the process.
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.
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 a reference to it.
Returns None otherwise.
If the value is a string, returns its associated str.
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 object, returns a reference to it.
Returns None otherwise.