pub struct DocCommentBlock {
pub kind: DocCommentKind,
pub start_line: usize,
pub end_line: usize,
pub byte_start: usize,
pub byte_end: usize,
pub markdown: String,
pub line_metadata: Vec<DocCommentLineInfo>,
pub prefix_byte_lengths: Vec<usize>,
}Expand description
A contiguous block of same-kind doc comments extracted from a Rust source file.
Fields§
§kind: DocCommentKindWhether this is an outer (///) or inner (//!) doc comment.
start_line: usize0-indexed line number of the first line in the original file.
end_line: usize0-indexed line number of the last line in the original file (inclusive).
byte_start: usizeByte offset of the first character of the first line in the block.
byte_end: usizeByte offset past the last character (including \n) of the last line in the block.
markdown: StringExtracted markdown content with prefixes stripped.
line_metadata: Vec<DocCommentLineInfo>Per-line metadata for prefix restoration during fix mode.
prefix_byte_lengths: Vec<usize>Length of leading whitespace + prefix (in bytes) for column offset remapping.
Each entry corresponds to a line in line_metadata.
Trait Implementations§
Source§impl Clone for DocCommentBlock
impl Clone for DocCommentBlock
Source§fn clone(&self) -> DocCommentBlock
fn clone(&self) -> DocCommentBlock
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for DocCommentBlock
impl RefUnwindSafe for DocCommentBlock
impl Send for DocCommentBlock
impl Sync for DocCommentBlock
impl Unpin for DocCommentBlock
impl UnsafeUnpin for DocCommentBlock
impl UnwindSafe for DocCommentBlock
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more