Enum liquid_value::Value [−][src]
An enum to represent different value types
Variants
Scalar(Scalar)
A scalar value.
Array(Array)
A sequence of Value
s.
Object(Object)
A sequence of key/Value
pairs.
Nil
Nothing.
Methods
impl Value
[src]
impl Value
pub fn scalar<T: Into<Scalar>>(value: T) -> Self
[src]
pub fn scalar<T: Into<Scalar>>(value: T) -> Self
Create as a Scalar
.
pub fn array<I: IntoIterator<Item = Self>>(iter: I) -> Self
[src]
pub fn array<I: IntoIterator<Item = Self>>(iter: I) -> Self
Create as an Array
.
pub fn nil() -> Self
[src]
pub fn nil() -> Self
Create as nothing.
pub fn to_str(&self) -> Cow<str>
[src]
pub fn to_str(&self) -> Cow<str>
Interpret as a string.
pub fn as_scalar(&self) -> Option<&Scalar>
[src]
pub fn as_scalar(&self) -> Option<&Scalar>
Extracts the scalar value if it is a scalar.
pub fn is_scalar(&self) -> bool
[src]
pub fn is_scalar(&self) -> bool
Tests whether this value is a scalar
pub fn as_array(&self) -> Option<&Array>
[src]
pub fn as_array(&self) -> Option<&Array>
Extracts the array value if it is an array.
pub fn as_array_mut(&mut self) -> Option<&mut Array>
[src]
pub fn as_array_mut(&mut self) -> Option<&mut Array>
Extracts the array value if it is an array.
pub fn is_array(&self) -> bool
[src]
pub fn is_array(&self) -> bool
Tests whether this value is an array
pub fn as_object(&self) -> Option<&Object>
[src]
pub fn as_object(&self) -> Option<&Object>
Extracts the object value if it is a object.
pub fn as_object_mut(&mut self) -> Option<&mut Object>
[src]
pub fn as_object_mut(&mut self) -> Option<&mut Object>
Extracts the object value if it is a object.
pub fn is_object(&self) -> bool
[src]
pub fn is_object(&self) -> bool
Tests whether this value is an object
pub fn is_nil(&self) -> bool
[src]
pub fn is_nil(&self) -> bool
Tests whether this value is nil
pub fn is_truthy(&self) -> bool
[src]
pub fn is_truthy(&self) -> bool
Evaluate using Liquid "truthiness"
pub fn is_default(&self) -> bool
[src]
pub fn is_default(&self) -> bool
Whether a default constructed value.
pub fn type_name(&self) -> &'static str
[src]
pub fn type_name(&self) -> &'static str
Report the data type (generally for error reporting).
pub fn get<'i, I: Into<&'i Index>>(&self, index: I) -> Option<&Self>
[src]
pub fn get<'i, I: Into<&'i Index>>(&self, index: I) -> Option<&Self>
Access a contained Value
.
Trait Implementations
impl Clone for Value
[src]
impl Clone for Value
fn clone(&self) -> Value
[src]
fn clone(&self) -> Value
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Value
[src]
impl Debug for Value
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Value
[src]
impl Default for Value
impl PartialEq<Value> for Value
[src]
impl PartialEq<Value> for Value
fn eq(&self, other: &Self) -> bool
[src]
fn eq(&self, other: &Self) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Eq for Value
[src]
impl Eq for Value
impl PartialOrd<Value> for Value
[src]
impl PartialOrd<Value> for Value
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
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]
fn lt(&self, other: &Rhs) -> bool
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]
fn le(&self, other: &Rhs) -> bool
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]
fn gt(&self, other: &Rhs) -> bool
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]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Display for Value
[src]
impl Display for Value