Enum liquid::Value
[−]
[src]
pub enum Value { Num(f32), Bool(bool), Str(String), Array(Array), Object(Object), Nil, }
An enum to represent different value types
Variants
Num(f32)
Bool(bool)
Str(String)
Array(Array)
Object(Object)
Nil
Methods
impl Value
[src]
fn str(val: &str) -> Value
[src]
Shorthand function to create Value::Str from a string slice.
fn as_float(&self) -> Option<f32>
[src]
Extracts the float value if it is a float.
fn is_float(&self) -> bool
[src]
Tests whether this value is a float
fn as_bool(&self) -> Option<bool>
[src]
Extracts the boolean value if it is a boolean.
fn is_bool(&self) -> bool
[src]
Tests whether this value is a boolean
fn as_str(&self) -> Option<&str>
[src]
Extracts the str value if it is a str.
fn is_str(&self) -> bool
[src]
Tests whether this value is a str
fn as_array(&self) -> Option<&Vec<Value>>
[src]
Extracts the array value if it is an array.
fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>
[src]
Extracts the array value if it is an array.
fn is_array(&self) -> bool
[src]
Tests whether this value is an array
fn as_object(&self) -> Option<&Object>
[src]
Extracts the object value if it is a object.
fn as_object_mut(&mut self) -> Option<&mut Object>
[src]
Extracts the object value if it is a object.
fn is_object(&self) -> bool
[src]
Extracts the object value if it is a object.
fn get<'i, I: Into<&'i Index>>(&self, index: I) -> Option<&Self>
[src]
Trait Implementations
impl Clone for Value
[src]
fn clone(&self) -> Value
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Value
[src]
impl PartialEq<Value> for Value
[src]
fn eq(&self, other: &Value) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Value
[src]
impl PartialOrd<Value> for Value
[src]
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more