pub struct NestedComment {
pub container_path: Vec<CommentPathSegment>,
pub position: usize,
pub text: String,
pub inline: bool,
}Expand description
A comment that appears inside a nested mapping or sequence.
container_path locates the immediate parent container.
Position semantics depend on inline:
- Own-line (
inline = false):positionis the slot ordinal within the container’s child list, ranging0..=child_count. The comment is rendered before the child at this position.position == child_countmeans “after all children”. - Inline (
inline = true):positionis the host child’s index, ranging0..child_count. The comment is attached to that child’s trailing line. An inline comment whose host is missing at emit time (orphan) degrades to an own-line comment at the same indent.
Fields§
§container_path: Vec<CommentPathSegment>§position: usize§text: String§inline: boolTrait Implementations§
Source§impl Clone for NestedComment
impl Clone for NestedComment
Source§fn clone(&self) -> NestedComment
fn clone(&self) -> NestedComment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NestedComment
impl Debug for NestedComment
Source§impl PartialEq for NestedComment
impl PartialEq for NestedComment
Source§fn eq(&self, other: &NestedComment) -> bool
fn eq(&self, other: &NestedComment) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for NestedComment
impl StructuralPartialEq for NestedComment
Auto Trait Implementations§
impl Freeze for NestedComment
impl RefUnwindSafe for NestedComment
impl Send for NestedComment
impl Sync for NestedComment
impl Unpin for NestedComment
impl UnsafeUnpin for NestedComment
impl UnwindSafe for NestedComment
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.