Enum hipack::value::Value
[−]
[src]
pub enum Value { Bool(bool), Integer(i64), Float(f64), String(String), List(Vec<Value>), Dict(BTreeMap<String, Value>), }
Variants
Bool(bool)
Integer(i64)
Float(f64)
String(String)
List(Vec<Value>)
Dict(BTreeMap<String, Value>)
Methods
impl Value
[src]
fn is_bool(&self) -> bool
Returns true if the Value
is a bool, otherwise returns false.
fn as_bool(&self) -> Option<bool>
If the Value
is a boolean, return the associated bool. Returns None otherwise.
fn is_integer(&self) -> bool
Returns true if Value
is an integer, otherwise returns false.
fn as_integer(&self) -> Option<i64>
If the Value
is an integer, return the associated i64. Returns None otherwise.
fn is_float(&self) -> bool
Returns true if Value
is a floating point number, otherwise returns false.
fn as_float(&self) -> Option<f64>
If the Value
is a floating point number, return the associated f64. Returns None
otherwise.
fn is_number(&self) -> bool
Returns true if Value
is a number (either integer or floating point), otherwise returns
false.
fn as_number(&self) -> Option<f64>
If the Value
is numeric, returns it as a f64. Return None otherwise.
fn is_string(&self) -> bool
Returns true if Value
is a String, otherwise returns false.
fn as_string(&self) -> Option<&str>
If the Value
is a string, returns the associated String. Returns None otherwise.
fn is_list(&self) -> bool
Returns true if Value
is a List, otherwise returns false.
fn as_list(&self) -> Option<&Vec<Value>>
If the Value
is a list, returns the associated Vec
fn is_dict(&self) -> bool
Return true if Value
is a Dict, otherwise returns false.
fn as_dict(&self) -> Option<&BTreeMap<String, Value>>
If the Value
is a dictionary, returns the associated BTreeMap
Trait Implementations
impl Clone for Value
[src]
fn clone(&self) -> Value
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more