pub struct LineInfo {Show 25 fields
pub byte_offset: usize,
pub byte_len: usize,
pub indent: usize,
pub visual_indent: usize,
pub is_blank: bool,
pub in_code_block: bool,
pub in_front_matter: bool,
pub in_html_block: bool,
pub in_html_comment: bool,
pub list_item: Option<ListItemInfo>,
pub heading: Option<HeadingInfo>,
pub blockquote: Option<BlockquoteInfo>,
pub in_mkdocstrings: bool,
pub in_esm_block: bool,
pub in_code_span_continuation: bool,
pub is_horizontal_rule: bool,
pub in_math_block: bool,
pub in_quarto_div: bool,
pub in_jsx_expression: bool,
pub in_mdx_comment: bool,
pub in_jsx_component: bool,
pub in_jsx_fragment: bool,
pub in_admonition: bool,
pub in_content_tab: bool,
pub in_definition_list: bool,
}Expand description
Pre-computed information about a line
Fields§
§byte_offset: usizeByte offset where this line starts in the document
byte_len: usizeLength of the line in bytes (without newline)
indent: usizeNumber of bytes of leading whitespace (for substring extraction)
visual_indent: usizeVisual column width of leading whitespace (with proper tab expansion) Per CommonMark, tabs expand to the next column that is a multiple of 4. Use this for numeric comparisons like checking for indented code blocks (>= 4).
is_blank: boolWhether the line is blank (empty or only whitespace)
in_code_block: boolWhether this line is inside a code block
in_front_matter: boolWhether this line is inside front matter
in_html_block: boolWhether this line is inside an HTML block
in_html_comment: boolWhether this line is inside an HTML comment
list_item: Option<ListItemInfo>List item information if this line starts a list item
heading: Option<HeadingInfo>Heading information if this line is a heading
blockquote: Option<BlockquoteInfo>Blockquote information if this line is a blockquote
in_mkdocstrings: boolWhether this line is inside a mkdocstrings autodoc block
in_esm_block: boolWhether this line is part of an ESM import/export block (MDX only)
in_code_span_continuation: boolWhether this line is a continuation of a multi-line code span from a previous line
is_horizontal_rule: boolWhether this line is a horizontal rule (—, ***, ___, etc.) Pre-computed for consistent detection across all rules
in_math_block: boolWhether this line is inside a math block ($$ … $$)
in_quarto_div: boolWhether this line is inside a Quarto div block (::: … :::)
in_jsx_expression: boolWhether this line contains or is inside a JSX expression (MDX only)
in_mdx_comment: boolWhether this line is inside an MDX comment {/* … */} (MDX only)
in_jsx_component: boolWhether this line is inside a JSX component (MDX only)
in_jsx_fragment: boolWhether this line is inside a JSX fragment (MDX only)
in_admonition: boolWhether this line is inside an MkDocs admonition block (!!! or ???)
in_content_tab: boolWhether this line is inside an MkDocs content tab block (===)
in_definition_list: boolWhether this line is a definition list item (: definition)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LineInfo
impl RefUnwindSafe for LineInfo
impl Send for LineInfo
impl Sync for LineInfo
impl Unpin for LineInfo
impl UnwindSafe for LineInfo
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
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>
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>
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