pub enum CommentPosition {
Leading,
Trailing,
Between(usize),
Standalone,
}Expand description
Position of a comment relative to AST nodes.
Comments can appear in various positions relative to the code they document, and this enum captures those relationships for proper formatting and preservation during transformations.
Variants§
Leading
Comment appears before the associated AST node
Trailing
Comment appears after the associated AST node on the same line
Between(usize)
Comment appears between elements in a container (index of preceding element)
Standalone
Standalone comment not associated with any specific AST node
Trait Implementations§
Source§impl Clone for CommentPosition
impl Clone for CommentPosition
Source§fn clone(&self) -> CommentPosition
fn clone(&self) -> CommentPosition
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 CommentPosition
impl Debug for CommentPosition
Source§impl PartialEq for CommentPosition
impl PartialEq for CommentPosition
Source§fn eq(&self, other: &CommentPosition) -> bool
fn eq(&self, other: &CommentPosition) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CommentPosition
Auto Trait Implementations§
impl Freeze for CommentPosition
impl RefUnwindSafe for CommentPosition
impl Send for CommentPosition
impl Sync for CommentPosition
impl Unpin for CommentPosition
impl UnsafeUnpin for CommentPosition
impl UnwindSafe for CommentPosition
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