#[repr(transparent)]pub struct ScalarCow<'s>(_);
Expand description
A Liquid scalar value
Implementations§
source§impl<'s> ScalarCow<'s>
impl<'s> ScalarCow<'s>
sourcepub fn new<T>(value: T) -> ScalarCow<'s>where
T: Into<ScalarCow<'s>>,
pub fn new<T>(value: T) -> ScalarCow<'s>where T: Into<ScalarCow<'s>>,
Convert a value into a ScalarCow
.
sourcepub fn into_owned(self) -> ScalarCow<'static>
pub fn into_owned(self) -> ScalarCow<'static>
Create an owned version of the value.
sourcepub fn as_view<'r>(&'r self) -> &'s (dyn ValueView + 's)where
'r: 's,
pub fn as_view<'r>(&'r self) -> &'s (dyn ValueView + 's)where 'r: 's,
Create a reference to the value.
sourcepub fn into_string(self) -> KStringBase<Box<str, Global>>
pub fn into_string(self) -> KStringBase<Box<str, Global>>
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<ScalarCow<'s>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<ScalarCow<'s>, <__D as Deserializer<'de>>::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>(&mut self, iter: T)where
T: IntoIterator<Item = ScalarCow<'s>>,
fn extend<T>(&mut self, iter: T)where T: IntoIterator<Item = ScalarCow<'s>>,
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 KStringRef<'s>> for ScalarCow<'s>
impl<'s> From<&'s KStringRef<'s>> for ScalarCow<'s>
source§fn from(s: &'s KStringRef<'s>) -> ScalarCow<'s>
fn from(s: &'s KStringRef<'s>) -> ScalarCow<'s>
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>) -> ScalarCow<'s>
fn from(s: KStringRef<'s>) -> ScalarCow<'s>
Converts to this type from the input type.
source§impl<'s> PartialEq<&'s str> for ScalarCow<'s>
impl<'s> PartialEq<&'s str> for ScalarCow<'s>
source§impl<'s> PartialEq<Date> for ScalarCow<'s>
impl<'s> PartialEq<Date> for ScalarCow<'s>
source§impl<'s> PartialEq<DateTime> for ScalarCow<'s>
impl<'s> PartialEq<DateTime> for ScalarCow<'s>
source§impl<'s> PartialEq<KStringBase<Box<str, Global>>> for ScalarCow<'s>
impl<'s> PartialEq<KStringBase<Box<str, Global>>> for ScalarCow<'s>
source§impl<'s> PartialEq<KStringCowBase<'s, Box<str, Global>>> for ScalarCow<'s>
impl<'s> PartialEq<KStringCowBase<'s, Box<str, Global>>> for ScalarCow<'s>
source§impl<'s> PartialEq<KStringRef<'s>> for ScalarCow<'s>
impl<'s> PartialEq<KStringRef<'s>> for ScalarCow<'s>
source§fn eq(&self, other: &KStringRef<'s>) -> bool
fn eq(&self, other: &KStringRef<'s>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'s> PartialEq<ScalarCow<'s>> for ScalarCow<'s>
impl<'s> PartialEq<ScalarCow<'s>> for ScalarCow<'s>
source§impl<'s> PartialEq<String> for ScalarCow<'s>
impl<'s> PartialEq<String> for ScalarCow<'s>
source§impl<'s> PartialEq<bool> for ScalarCow<'s>
impl<'s> PartialEq<bool> for ScalarCow<'s>
source§impl<'s> PartialOrd<Date> for ScalarCow<'s>
impl<'s> PartialOrd<Date> for ScalarCow<'s>
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<'s> PartialOrd<DateTime> for ScalarCow<'s>
impl<'s> PartialOrd<DateTime> for ScalarCow<'s>
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<'s> PartialOrd<KStringBase<Box<str, Global>>> for ScalarCow<'s>
impl<'s> PartialOrd<KStringBase<Box<str, Global>>> for ScalarCow<'s>
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<'s> PartialOrd<KStringCowBase<'s, Box<str, Global>>> for ScalarCow<'s>
impl<'s> PartialOrd<KStringCowBase<'s, Box<str, Global>>> for ScalarCow<'s>
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<'s> PartialOrd<KStringRef<'s>> for ScalarCow<'s>
impl<'s> PartialOrd<KStringRef<'s>> for ScalarCow<'s>
source§fn partial_cmp(&self, other: &KStringRef<'s>) -> Option<Ordering>
fn partial_cmp(&self, other: &KStringRef<'s>) -> Option<Ordering>
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<'s> PartialOrd<ScalarCow<'s>> for ScalarCow<'s>
impl<'s> PartialOrd<ScalarCow<'s>> for ScalarCow<'s>
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<'s> PartialOrd<String> for ScalarCow<'s>
impl<'s> PartialOrd<String> for ScalarCow<'s>
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<'s> PartialOrd<bool> for ScalarCow<'s>
impl<'s> PartialOrd<bool> for ScalarCow<'s>
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<'s> PartialOrd<f32> for ScalarCow<'s>
impl<'s> PartialOrd<f32> for ScalarCow<'s>
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<'s> PartialOrd<f64> for ScalarCow<'s>
impl<'s> PartialOrd<f64> for ScalarCow<'s>
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<'s> PartialOrd<i16> for ScalarCow<'s>
impl<'s> PartialOrd<i16> for ScalarCow<'s>
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<'s> PartialOrd<i32> for ScalarCow<'s>
impl<'s> PartialOrd<i32> for ScalarCow<'s>
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<'s> PartialOrd<i64> for ScalarCow<'s>
impl<'s> PartialOrd<i64> for ScalarCow<'s>
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<'s> PartialOrd<i8> for ScalarCow<'s>
impl<'s> PartialOrd<i8> for ScalarCow<'s>
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<'s> PartialOrd<str> for ScalarCow<'s>
impl<'s> PartialOrd<str> for ScalarCow<'s>
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<'s> PartialOrd<u16> for ScalarCow<'s>
impl<'s> PartialOrd<u16> for ScalarCow<'s>
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<'s> PartialOrd<u32> for ScalarCow<'s>
impl<'s> PartialOrd<u32> for ScalarCow<'s>
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<'s> PartialOrd<u8> for ScalarCow<'s>
impl<'s> PartialOrd<u8> for ScalarCow<'s>
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<'s> Serialize for ScalarCow<'s>
impl<'s> Serialize for ScalarCow<'s>
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
source§impl<'s> ValueView for ScalarCow<'s>
impl<'s> ValueView for ScalarCow<'s>
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 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§
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