Enum liquid::Value [] [src]

pub enum Value {
    Num(f32),
    Str(String),
    Object(HashMap<StringValue>),
    Array(Vec<Value>),
    Bool(bool),
}

An enum to represent different value types

Variants

Num(f32)Str(String)Object(HashMap<StringValue>)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>

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 Debug for Value
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

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 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 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: &Value) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, other: &Value) -> 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: &Value) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, other: &Value) -> bool

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]

fn to_string(&self) -> String

Converts the given value to a String. Read more

impl Renderable for Value
[src]

fn render(&self, _context: &mut Context) -> Result<Option<String>>

Renders the Renderable instance given a Liquid context. The Result that is returned signals if there was an error rendering, the Option that is wrapped by the Result will be None if the render has run successfully but there is no content to render. Read more