Enum liquid_core::model::ValueCow
source · pub enum ValueCow<'s> {
Owned(Value),
Borrowed(&'s dyn ValueView),
}Expand description
Abstract the lifetime of a Value.
Variants§
Implementations§
Trait Implementations§
source§impl<'v> PartialEq<&'v str> for ValueCow<'v>
impl<'v> PartialEq<&'v str> for ValueCow<'v>
source§impl<'v> PartialEq<Date> for ValueCow<'v>
impl<'v> PartialEq<Date> for ValueCow<'v>
source§impl<'v> PartialEq<DateTime> for ValueCow<'v>
impl<'v> PartialEq<DateTime> for ValueCow<'v>
source§impl<'v> PartialEq<KStringBase<Box<str>>> for ValueCow<'v>
impl<'v> PartialEq<KStringBase<Box<str>>> for ValueCow<'v>
source§impl<'v> PartialEq<KStringCowBase<'v>> for ValueCow<'v>
impl<'v> PartialEq<KStringCowBase<'v>> for ValueCow<'v>
source§fn eq(&self, other: &KStringCow<'v>) -> bool
fn eq(&self, other: &KStringCow<'v>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<'v> PartialEq<KStringRef<'v>> for ValueCow<'v>
impl<'v> PartialEq<KStringRef<'v>> for ValueCow<'v>
source§fn eq(&self, other: &KStringRef<'v>) -> bool
fn eq(&self, other: &KStringRef<'v>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<'v> PartialEq<String> for ValueCow<'v>
impl<'v> PartialEq<String> for ValueCow<'v>
source§impl<'v> PartialEq<Value> for ValueCow<'v>
impl<'v> PartialEq<Value> for ValueCow<'v>
source§impl<'v> PartialEq<ValueViewCmp<'v>> for ValueCow<'v>
impl<'v> PartialEq<ValueViewCmp<'v>> for ValueCow<'v>
source§fn eq(&self, other: &ValueViewCmp<'v>) -> bool
fn eq(&self, other: &ValueViewCmp<'v>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<'v> PartialEq<bool> for ValueCow<'v>
impl<'v> PartialEq<bool> for ValueCow<'v>
source§impl<'v> PartialEq for ValueCow<'v>
impl<'v> PartialEq for ValueCow<'v>
source§impl<'s> ValueView for ValueCow<'s>
impl<'s> ValueView for ValueCow<'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 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.
Auto Trait Implementations§
impl<'s> Freeze for ValueCow<'s>
impl<'s> !RefUnwindSafe for ValueCow<'s>
impl<'s> !Send for ValueCow<'s>
impl<'s> !Sync for ValueCow<'s>
impl<'s> Unpin for ValueCow<'s>
impl<'s> !UnwindSafe for ValueCow<'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> 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