pub(crate) enum Value {
Mapping(Mapping),
Leaf(Leaf),
Opaque(Opaque),
}Expand description
A value in the tree.
Variants§
Mapping(Mapping)
A block mapping.
Leaf(Leaf)
The raw text of any other value, from the end of the owning key through the end of its last line.
Opaque(Opaque)
The raw text of a flow mapping with entries, or of a mapping the tree cannot edit, such as one with explicit keys or mixed indentation. It spans the same text as a leaf.
Implementations§
Source§impl Value
impl Value
Sourcepub(crate) fn mapping(&self) -> Option<&Mapping>
pub(crate) fn mapping(&self) -> Option<&Mapping>
The mapping, when this is one. A flow mapping gives its block rewrite.
Sourcepub(crate) fn mapping_mut(&mut self) -> Option<&mut Mapping>
pub(crate) fn mapping_mut(&mut self) -> Option<&mut Mapping>
The mapping, mutably, when this is one.
Sourcepub(crate) const fn is_unsupported(&self) -> bool
pub(crate) const fn is_unsupported(&self) -> bool
Whether this is a mapping the tree cannot edit.
Sourcefn keep_comment(&mut self, comment: &str)
fn keep_comment(&mut self, comment: &str)
Put comment on the key line unless it has one.
fn terminate(&mut self)
Trait Implementations§
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.