Struct liquid_interpreter::value::Scalar
source · pub struct Scalar(_);
Expand description
A Liquid scalar value
Implementations§
source§impl Scalar
impl Scalar
sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Convert to a string.
sourcepub fn to_integer(&self) -> Option<i32>
pub fn to_integer(&self) -> Option<i32>
Interpret as an integer, if possible
sourcepub fn to_date(&self) -> Option<DateTime<FixedOffset>>
pub fn to_date(&self) -> Option<DateTime<FixedOffset>>
Interpret as a date, if possible
sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Whether a default constructed value.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Scalar
impl<'de> Deserialize<'de> for Scalar
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Scalar, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Scalar, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Extend<Scalar> for Path
impl Extend<Scalar> for Path
source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Scalar>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Scalar>,
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl Extend<Scalar> for Variable
impl Extend<Scalar> for Variable
source§fn extend<T: IntoIterator<Item = Scalar>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Scalar>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl FromIterator<Scalar> for Path
impl FromIterator<Scalar> for Path
source§impl PartialOrd<Scalar> for Scalar
impl PartialOrd<Scalar> for Scalar
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl Serialize for Scalar
impl Serialize for Scalar
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more