Enum liquid::Value
[−]
[src]
pub enum Value { Scalar(Scalar), Array(Array), Object(Object), Nil, }
An enum to represent different value types
Variants
Scalar(Scalar)
Array(Array)
Object(Object)
Nil
Methods
impl Value
[src]
pub fn scalar<T: Into<Scalar>>(value: T) -> Self
[src]
pub fn array<I: IntoIterator<Item = Self>>(iter: I) -> Self
[src]
pub fn nil() -> Self
[src]
pub fn to_str(&self) -> Cow<str>
[src]
pub fn as_scalar(&self) -> Option<&Scalar>
[src]
Extracts the scalar value if it is a scalar.
pub fn is_scalar(&self) -> bool
[src]
Tests whether this value is a scalar
pub fn as_array(&self) -> Option<&Array>
[src]
Extracts the array value if it is an array.
pub fn as_array_mut(&mut self) -> Option<&mut Array>
[src]
Extracts the array value if it is an array.
pub fn is_array(&self) -> bool
[src]
Tests whether this value is an array
pub fn as_object(&self) -> Option<&Object>
[src]
Extracts the object value if it is a object.
pub fn as_object_mut(&mut self) -> Option<&mut Object>
[src]
Extracts the object value if it is a object.
pub fn is_object(&self) -> bool
[src]
Tests whether this value is an object
pub fn is_nil(&self) -> bool
[src]
Tests whether this value is nil
pub fn is_truthy(&self) -> bool
[src]
Evaluate using Liquid "truthiness"
pub fn is_default(&self) -> bool
[src]
pub fn type_name(&self) -> &'static str
[src]
pub 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]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Default for Value
[src]
impl PartialEq<Value> for Value
[src]
fn eq(&self, other: &Self) -> 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: &Self) -> 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