pub struct ScalarCow<'s>(/* private fields */);
Expand description
A Liquid scalar value
Implementations§
Source§impl<'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§
Source§impl<'de, 's> Deserialize<'de> for ScalarCow<'s>
impl<'de, 's> Deserialize<'de> for ScalarCow<'s>
Source§fn 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
Source§impl<'s> Extend<ScalarCow<'s>> for Path<'s>
impl<'s> Extend<ScalarCow<'s>> for Path<'s>
Source§fn 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
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<ScalarCow<'static>> for Variable
impl Extend<ScalarCow<'static>> 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<'s> From<&'s KStringCowBase<'s>> for ScalarCow<'s>
impl<'s> From<&'s KStringCowBase<'s>> for ScalarCow<'s>
Source§fn from(s: &'s KStringCow<'s>) -> Self
fn from(s: &'s KStringCow<'s>) -> Self
Converts to this type from the input type.
Source§impl<'s> From<&'s KStringRef<'s>> for ScalarCow<'s>
impl<'s> From<&'s KStringRef<'s>> for ScalarCow<'s>
Source§fn from(s: &'s KStringRef<'s>) -> Self
fn from(s: &'s KStringRef<'s>) -> Self
Converts to this type from the input type.
Source§impl<'s> From<KStringCowBase<'s>> for ScalarCow<'s>
impl<'s> From<KStringCowBase<'s>> for ScalarCow<'s>
Source§fn from(s: KStringCow<'s>) -> Self
fn from(s: KStringCow<'s>) -> Self
Converts to this type from the input type.
Source§impl<'s> From<KStringRef<'s>> for ScalarCow<'s>
impl<'s> From<KStringRef<'s>> for ScalarCow<'s>
Source§fn from(s: KStringRef<'s>) -> Self
fn from(s: KStringRef<'s>) -> Self
Converts to this type from the input type.
Source§impl<'s> PartialEq<KStringCowBase<'s>> for ScalarCow<'s>
impl<'s> PartialEq<KStringCowBase<'s>> for ScalarCow<'s>
Source§impl<'s> PartialEq<KStringRef<'s>> for ScalarCow<'s>
impl<'s> PartialEq<KStringRef<'s>> for ScalarCow<'s>
Source§impl PartialOrd<Date> for ScalarCow<'_>
impl PartialOrd<Date> for ScalarCow<'_>
Source§impl PartialOrd<DateTime> for ScalarCow<'_>
impl PartialOrd<DateTime> for ScalarCow<'_>
Source§impl PartialOrd<KStringBase<Box<str>>> for ScalarCow<'_>
impl PartialOrd<KStringBase<Box<str>>> for ScalarCow<'_>
Source§impl<'s> PartialOrd<KStringCowBase<'s>> for ScalarCow<'s>
impl<'s> PartialOrd<KStringCowBase<'s>> for ScalarCow<'s>
Source§impl<'s> PartialOrd<KStringRef<'s>> for ScalarCow<'s>
impl<'s> PartialOrd<KStringRef<'s>> for ScalarCow<'s>
Source§impl PartialOrd<String> for ScalarCow<'_>
impl PartialOrd<String> for ScalarCow<'_>
Source§impl PartialOrd<bool> for ScalarCow<'_>
impl PartialOrd<bool> for ScalarCow<'_>
Source§impl<'s> PartialOrd<f32> for ScalarCow<'s>
impl<'s> PartialOrd<f32> for ScalarCow<'s>
Source§impl PartialOrd<f64> for ScalarCow<'_>
impl PartialOrd<f64> for ScalarCow<'_>
Source§impl<'s> PartialOrd<i16> for ScalarCow<'s>
impl<'s> PartialOrd<i16> for ScalarCow<'s>
Source§impl<'s> PartialOrd<i32> for ScalarCow<'s>
impl<'s> PartialOrd<i32> for ScalarCow<'s>
Source§impl PartialOrd<i64> for ScalarCow<'_>
impl PartialOrd<i64> for ScalarCow<'_>
Source§impl<'s> PartialOrd<i8> for ScalarCow<'s>
impl<'s> PartialOrd<i8> for ScalarCow<'s>
Source§impl PartialOrd<str> for ScalarCow<'_>
impl PartialOrd<str> for ScalarCow<'_>
Source§impl<'s> PartialOrd<u16> for ScalarCow<'s>
impl<'s> PartialOrd<u16> for ScalarCow<'s>
Source§impl<'s> PartialOrd<u32> for ScalarCow<'s>
impl<'s> PartialOrd<u32> for ScalarCow<'s>
Source§impl<'s> PartialOrd<u8> for ScalarCow<'s>
impl<'s> PartialOrd<u8> for ScalarCow<'s>
Source§impl<'s> PartialOrd for ScalarCow<'s>
impl<'s> PartialOrd for ScalarCow<'s>
Source§impl ValueView for ScalarCow<'_>
impl ValueView for ScalarCow<'_>
Source§fn render(&self) -> DisplayCow<'_>
fn render(&self) -> DisplayCow<'_>
A
Display
for a BoxedValue
rendered for the user.Source§fn source(&self) -> DisplayCow<'_>
fn source(&self) -> DisplayCow<'_>
A
Display
for a Value
as source code.Source§fn query_state(&self, state: State) -> bool
fn query_state(&self, state: State) -> bool
Query the value’s state
Source§fn to_kstr(&self) -> KStringCow<'_>
fn to_kstr(&self) -> KStringCow<'_>
Interpret as a string.
Source§fn as_object(&self) -> Option<&dyn ObjectView>
fn as_object(&self) -> Option<&dyn ObjectView>
Extracts the object value if it is a object.
impl Eq for ScalarCow<'_>
Auto Trait Implementations§
impl<'s> Freeze for ScalarCow<'s>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more