pub(crate) struct Leaf {
value: Text,
tail: Text,
decoded: Option<String>,
}Expand description
The raw text of a value, from the end of the owning key through the end
of its last line. The tail holds what follows the value on that line,
such as a comment. decoded is the scalar the text spells, when it is one.
Fields§
§value: Text§tail: Text§decoded: Option<String>Implementations§
Source§impl Leaf
impl Leaf
pub(super) const fn new( value: Text, tail: Text, decoded: Option<String>, ) -> Self
Sourcepub(super) fn terminate(&mut self)
pub(super) fn terminate(&mut self)
End the last line with a line break, adding one when it is missing.
Sourcepub(super) fn comment(&self) -> Option<&str>
pub(super) fn comment(&self) -> Option<&str>
The comment on the key line, with the whitespace before it. For a multi-line value this is the one after the block scalar indicator.
Sourcepub(super) fn keep_comment(&mut self, comment: &str)
pub(super) fn keep_comment(&mut self, comment: &str)
Put comment on the key line unless it has one. After a multi-line
value, the key line is the one with the block scalar indicator.
Trait Implementations§
impl Eq for Leaf
impl StructuralPartialEq for Leaf
Auto Trait Implementations§
impl Freeze for Leaf
impl RefUnwindSafe for Leaf
impl Send for Leaf
impl Sync for Leaf
impl Unpin for Leaf
impl UnsafeUnpin for Leaf
impl UnwindSafe for Leaf
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.