pub struct MarkdownElement {
pub kind: ElementKind,
pub section_id: Option<usize>,
pub source_line: usize,
}Expand description
A single markdown element that can be rendered to ratatui.
Fields§
§kind: ElementKindThe kind of element content.
section_id: Option<usize>The section this element belongs to (for collapse/expand). None means this element is not part of any collapsible section.
source_line: usizeThe source line number (1-indexed) in the original markdown. Used for double-click reporting. Default is 0 (unknown).
Implementations§
Source§impl MarkdownElement
Constructor for MarkdownElement.
impl MarkdownElement
Constructor for MarkdownElement.
Sourcepub fn new(
kind: ElementKind,
section_id: Option<usize>,
source_line: usize,
) -> MarkdownElement
Available on crate feature markdown-preview only.
pub fn new( kind: ElementKind, section_id: Option<usize>, source_line: usize, ) -> MarkdownElement
markdown-preview only.Create a new markdown element with source line tracking.
Trait Implementations§
Source§impl Clone for MarkdownElement
impl Clone for MarkdownElement
Source§fn clone(&self) -> MarkdownElement
fn clone(&self) -> MarkdownElement
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 moreSource§impl Debug for MarkdownElement
impl Debug for MarkdownElement
Source§impl Default for MarkdownElement
impl Default for MarkdownElement
Source§fn default() -> MarkdownElement
fn default() -> MarkdownElement
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MarkdownElement
impl RefUnwindSafe for MarkdownElement
impl Send for MarkdownElement
impl Sync for MarkdownElement
impl Unpin for MarkdownElement
impl UnsafeUnpin for MarkdownElement
impl UnwindSafe for MarkdownElement
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