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<KStringCowBase<'v>> for ValueCow<'v>
impl<'v> PartialEq<KStringCowBase<'v>> for ValueCow<'v>
Source§impl<'v> PartialEq<KStringRef<'v>> for ValueCow<'v>
impl<'v> PartialEq<KStringRef<'v>> for ValueCow<'v>
Source§impl<'v> PartialEq<ValueViewCmp<'v>> for ValueCow<'v>
impl<'v> PartialEq<ValueViewCmp<'v>> for ValueCow<'v>
Source§impl ValueView for ValueCow<'_>
impl ValueView for ValueCow<'_>
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) -> KStringCowBase<'_>
fn to_kstr(&self) -> KStringCowBase<'_>
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> 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