Struct preserves::value::repr::PlainValue
source · pub struct PlainValue<D: Embeddable>(/* private fields */);
Expand description
A simple tree representation without any reference counting.
Implementations§
source§impl<D: Embeddable> PlainValue<D>
impl<D: Embeddable> PlainValue<D>
pub fn annotations_mut(&mut self) -> &mut Annotations<Self>
pub fn value_mut(&mut self) -> &mut Value<Self>
Trait Implementations§
source§impl<D: Clone + Embeddable> Clone for PlainValue<D>
impl<D: Clone + Embeddable> Clone for PlainValue<D>
source§fn clone(&self) -> PlainValue<D>
fn clone(&self) -> PlainValue<D>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<D: Embeddable> Debug for PlainValue<D>
impl<D: Embeddable> Debug for PlainValue<D>
source§impl<D: Hash + Embeddable> Hash for PlainValue<D>
impl<D: Hash + Embeddable> Hash for PlainValue<D>
source§impl<D: Embeddable> NestedValue for PlainValue<D>
impl<D: Embeddable> NestedValue for PlainValue<D>
§type Embedded = D
type Embedded = D
Every representation of Preserves values has an associated type: that of the Rust data
able to be embedded inside a value.
source§fn wrap(anns: Annotations<Self>, v: Value<Self>) -> Self
fn wrap(anns: Annotations<Self>, v: Value<Self>) -> Self
Attaches the given Annotations to the Value.
source§fn annotations(&self) -> &Annotations<Self>
fn annotations(&self) -> &Annotations<Self>
Retrieves any annotations attached to
self
.source§fn pieces(self) -> (Annotations<Self>, Value<Self>)
fn pieces(self) -> (Annotations<Self>, Value<Self>)
Consumes
self
, yielding its annotations and underlying Value.source§fn value_owned(self) -> Value<Self>
fn value_owned(self) -> Value<Self>
Consumes
self
, yielding its underlying Value and discarding its annotations.source§fn value_class(&self) -> ValueClass
fn value_class(&self) -> ValueClass
Retrieves the ValueClass of
self
.source§fn debug_fmt(&self, f: &mut Formatter<'_>) -> Result
fn debug_fmt(&self, f: &mut Formatter<'_>) -> Result
Supplies an opportunity to customize debug formatting for
self
. Defaults to writing
@
-prefixed annotations followed by the underlying value.source§fn strip_annotations<M: NestedValue<Embedded = Self::Embedded>>(&self) -> M
fn strip_annotations<M: NestedValue<Embedded = Self::Embedded>>(&self) -> M
Yields a deep copy of
self
with all annotations (recursively) removed.source§impl<D: Ord + Embeddable> Ord for PlainValue<D>
impl<D: Ord + Embeddable> Ord for PlainValue<D>
source§fn cmp(&self, other: &PlainValue<D>) -> Ordering
fn cmp(&self, other: &PlainValue<D>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<D: PartialEq + Embeddable> PartialEq for PlainValue<D>
impl<D: PartialEq + Embeddable> PartialEq for PlainValue<D>
source§fn eq(&self, other: &PlainValue<D>) -> bool
fn eq(&self, other: &PlainValue<D>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<D: PartialOrd + Embeddable> PartialOrd for PlainValue<D>
impl<D: PartialOrd + Embeddable> PartialOrd for PlainValue<D>
source§fn partial_cmp(&self, other: &PlainValue<D>) -> Option<Ordering>
fn partial_cmp(&self, other: &PlainValue<D>) -> 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 moreimpl<D: Eq + Embeddable> Eq for PlainValue<D>
impl<D: Embeddable> StructuralPartialEq for PlainValue<D>
Auto Trait Implementations§
impl<D> Freeze for PlainValue<D>where
D: Freeze,
impl<D> RefUnwindSafe for PlainValue<D>where
D: RefUnwindSafe,
impl<D> Send for PlainValue<D>where
D: Send,
impl<D> Sync for PlainValue<D>where
D: Sync,
impl<D> Unpin for PlainValue<D>where
D: Unpin,
impl<D> UnwindSafe for PlainValue<D>where
D: UnwindSafe + RefUnwindSafe,
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