Struct liquid_value::Scalar [−][src]
pub struct Scalar(_);
A Liquid scalar value
Methods
impl Scalar
[src]
impl Scalar
pub fn new<T: Into<Self>>(value: T) -> Self
[src]
pub fn new<T: Into<Self>>(value: T) -> Self
Convert a value into a Scalar
.
pub fn to_str(&self) -> Cow<str>
[src]
pub fn to_str(&self) -> Cow<str>
Interpret as a string.
pub fn into_string(self) -> String
[src]
pub fn into_string(self) -> String
Convert to a string.
pub fn to_integer(&self) -> Option<i32>
[src]
pub fn to_integer(&self) -> Option<i32>
Interpret as an integer, if possible
pub fn to_float(&self) -> Option<f64>
[src]
pub fn to_float(&self) -> Option<f64>
Interpret as an float, if possible
pub fn to_bool(&self) -> Option<bool>
[src]
pub fn to_bool(&self) -> Option<bool>
Interpret as an bool, if possible
pub fn to_date(&self) -> Option<Date>
[src]
pub fn to_date(&self) -> Option<Date>
Interpret as an bool, if possible
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).
Trait Implementations
impl Clone for Scalar
[src]
impl Clone for Scalar
fn clone(&self) -> Scalar
[src]
fn clone(&self) -> Scalar
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 Scalar
[src]
impl Debug for Scalar
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 From<i32> for Scalar
[src]
impl From<i32> for Scalar
impl From<f64> for Scalar
[src]
impl From<f64> for Scalar
impl From<bool> for Scalar
[src]
impl From<bool> for Scalar
impl From<Date> for Scalar
[src]
impl From<Date> for Scalar
impl From<String> for Scalar
[src]
impl From<String> for Scalar
impl<'a> From<&'a String> for Scalar
[src]
impl<'a> From<&'a String> for Scalar
impl From<&'static str> for Scalar
[src]
impl From<&'static str> for Scalar
impl PartialEq<Scalar> for Scalar
[src]
impl PartialEq<Scalar> for Scalar
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 Scalar
[src]
impl Eq for Scalar
impl PartialOrd<Scalar> for Scalar
[src]
impl PartialOrd<Scalar> for Scalar
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 Scalar
[src]
impl Display for Scalar