Enum liquid::Value
[−]
[src]
pub enum Value { Num(f32), Str(String), Object(HashMap<String, Value>), Array(Vec<Value>), Bool(bool), }
An enum to represent different value types
Variants
Num(f32)
Str(String)
Object(HashMap<String, Value>)
Array(Vec<Value>)
Bool(bool)
Methods
impl<'a> Value
[src]
fn str(val: &str) -> Value
Shorthand function to create Value::Str from a string slice.
fn as_str(&'a self) -> Option<&'a str>
fn from_token(t: &Token) -> Result<Value, Error>
Parses a token that can possibly represent a Value to said Value. Returns an Err if the token can not be interpreted as a Value.
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
impl Debug for Value
[src]
impl PartialEq<Value> for Value
[src]
fn eq(&self, other: &Value) -> 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
This method tests for !=
.
impl Eq for Value
[src]
impl PartialOrd<Value> for Value
[src]
fn partial_cmp(&self, other: &Value) -> 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
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
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
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
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl ToString for Value
[src]
impl Renderable for Value
[src]
fn render(&self, _context: &mut Context) -> Result<Option<String>, Error>
Renders the Renderable instance given a Liquid context. The Result that is returned signals if there was an error rendering, the Option