Struct liquid_core::model::ScalarCow
source · [−]#[repr(transparent)]pub struct ScalarCow<'s>(_);
Expand description
A Liquid scalar value
Implementations
sourceimpl<'s> ScalarCow<'s>
impl<'s> ScalarCow<'s>
sourcepub fn into_owned(self) -> Scalar
pub fn into_owned(self) -> Scalar
Create an owned version of the value.
sourcepub fn into_string(self) -> KString
pub fn into_string(self) -> KString
Convert to a string.
sourcepub fn to_integer(&self) -> Option<i64>
pub fn to_integer(&self) -> Option<i64>
Interpret as an integer, if possible
sourcepub fn to_date_time(&self) -> Option<DateTime>
pub fn to_date_time(&self) -> Option<DateTime>
Interpret as a date time, if possible
sourcepub fn into_cow_str(self) -> Cow<'s, str>
pub fn into_cow_str(self) -> Cow<'s, str>
Interpret as a Cow str, borrowing if possible
Trait Implementations
sourceimpl<'de, 's> Deserialize<'de> for ScalarCow<'s>
impl<'de, 's> Deserialize<'de> for ScalarCow<'s>
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'s> Extend<ScalarCow<'s>> for Path<'s>
impl<'s> Extend<ScalarCow<'s>> for Path<'s>
sourcefn extend<T: IntoIterator<Item = ScalarCow<'s>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = ScalarCow<'s>>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl Extend<ScalarCow<'static>> for Variable
impl Extend<ScalarCow<'static>> for Variable
sourcefn 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
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<'s> From<&'s KStringCowBase<'s, Box<str, Global>>> for ScalarCow<'s>
impl<'s> From<&'s KStringCowBase<'s, Box<str, Global>>> for ScalarCow<'s>
sourcefn from(s: &'s KStringCow<'s>) -> Self
fn from(s: &'s KStringCow<'s>) -> Self
Converts to this type from the input type.
sourceimpl<'s> From<&'s KStringRef<'s>> for ScalarCow<'s>
impl<'s> From<&'s KStringRef<'s>> for ScalarCow<'s>
sourcefn from(s: &'s KStringRef<'s>) -> Self
fn from(s: &'s KStringRef<'s>) -> Self
Converts to this type from the input type.
sourceimpl<'s> From<KStringCowBase<'s, Box<str, Global>>> for ScalarCow<'s>
impl<'s> From<KStringCowBase<'s, Box<str, Global>>> for ScalarCow<'s>
sourcefn from(s: KStringCow<'s>) -> Self
fn from(s: KStringCow<'s>) -> Self
Converts to this type from the input type.
sourceimpl<'s> From<KStringRef<'s>> for ScalarCow<'s>
impl<'s> From<KStringRef<'s>> for ScalarCow<'s>
sourcefn from(s: KStringRef<'s>) -> Self
fn from(s: KStringRef<'s>) -> Self
Converts to this type from the input type.
sourceimpl<'s> PartialEq<KStringRef<'s>> for ScalarCow<'s>
impl<'s> PartialEq<KStringRef<'s>> for ScalarCow<'s>
sourceimpl<'s> PartialOrd<Date> for ScalarCow<'s>
impl<'s> PartialOrd<Date> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &Date) -> Option<Ordering>
fn partial_cmp(&self, other: &Date) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<DateTime> for ScalarCow<'s>
impl<'s> PartialOrd<DateTime> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &DateTime) -> Option<Ordering>
fn partial_cmp(&self, other: &DateTime) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<KStringBase<Box<str, Global>>> for ScalarCow<'s>
impl<'s> PartialOrd<KStringBase<Box<str, Global>>> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &KString) -> Option<Ordering>
fn partial_cmp(&self, other: &KString) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<KStringCowBase<'s, Box<str, Global>>> for ScalarCow<'s>
impl<'s> PartialOrd<KStringCowBase<'s, Box<str, Global>>> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &KStringCow<'s>) -> Option<Ordering>
fn partial_cmp(&self, other: &KStringCow<'s>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<KStringRef<'s>> for ScalarCow<'s>
impl<'s> PartialOrd<KStringRef<'s>> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &KStringRef<'s>) -> Option<Ordering>
fn partial_cmp(&self, other: &KStringRef<'s>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<ScalarCow<'s>> for ScalarCow<'s>
impl<'s> PartialOrd<ScalarCow<'s>> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<String> for ScalarCow<'s>
impl<'s> PartialOrd<String> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &String) -> Option<Ordering>
fn partial_cmp(&self, other: &String) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<bool> for ScalarCow<'s>
impl<'s> PartialOrd<bool> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &bool) -> Option<Ordering>
fn partial_cmp(&self, other: &bool) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<f32> for ScalarCow<'s>
impl<'s> PartialOrd<f32> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &f32) -> Option<Ordering>
fn partial_cmp(&self, other: &f32) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<f64> for ScalarCow<'s>
impl<'s> PartialOrd<f64> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &f64) -> Option<Ordering>
fn partial_cmp(&self, other: &f64) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<i16> for ScalarCow<'s>
impl<'s> PartialOrd<i16> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &i16) -> Option<Ordering>
fn partial_cmp(&self, other: &i16) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<i32> for ScalarCow<'s>
impl<'s> PartialOrd<i32> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &i32) -> Option<Ordering>
fn partial_cmp(&self, other: &i32) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<i64> for ScalarCow<'s>
impl<'s> PartialOrd<i64> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &i64) -> Option<Ordering>
fn partial_cmp(&self, other: &i64) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<i8> for ScalarCow<'s>
impl<'s> PartialOrd<i8> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &i8) -> Option<Ordering>
fn partial_cmp(&self, other: &i8) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<str> for ScalarCow<'s>
impl<'s> PartialOrd<str> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &str) -> Option<Ordering>
fn partial_cmp(&self, other: &str) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<u16> for ScalarCow<'s>
impl<'s> PartialOrd<u16> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &u16) -> Option<Ordering>
fn partial_cmp(&self, other: &u16) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<u32> for ScalarCow<'s>
impl<'s> PartialOrd<u32> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &u32) -> Option<Ordering>
fn partial_cmp(&self, other: &u32) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> PartialOrd<u8> for ScalarCow<'s>
impl<'s> PartialOrd<u8> for ScalarCow<'s>
sourcefn partial_cmp(&self, other: &u8) -> Option<Ordering>
fn partial_cmp(&self, other: &u8) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'s> ValueView for ScalarCow<'s>
impl<'s> ValueView for ScalarCow<'s>
sourcefn render(&self) -> DisplayCow<'_>
fn render(&self) -> DisplayCow<'_>
A Display
for a BoxedValue
rendered for the user.
sourcefn source(&self) -> DisplayCow<'_>
fn source(&self) -> DisplayCow<'_>
A Display
for a Value
as source code.
sourcefn query_state(&self, state: State) -> bool
fn query_state(&self, state: State) -> bool
Query the value’s state
sourcefn to_kstr(&self) -> KStringCow<'_>
fn to_kstr(&self) -> KStringCow<'_>
Interpret as a string.
sourcefn as_object(&self) -> Option<&dyn ObjectView>
fn as_object(&self) -> Option<&dyn ObjectView>
Extracts the object value if it is a object.
impl<'s> Eq for ScalarCow<'s>
Auto Trait Implementations
impl<'s> RefUnwindSafe for ScalarCow<'s>
impl<'s> Send for ScalarCow<'s>
impl<'s> Sync for ScalarCow<'s>
impl<'s> Unpin for ScalarCow<'s>
impl<'s> UnwindSafe for ScalarCow<'s>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more