pub struct LineMetrics {
pub font_size: Pixels,
pub line_height: Pixels,
pub is_quote: bool,
pub is_code_block: bool,
pub is_thematic_break: bool,
pub task_state: Option<bool>,
}Expand description
Visual layout metrics and block-level decorations for a single rendered line.
Fields§
§font_size: PixelsFont size in pixels for this line.
line_height: PixelsVertical line height in pixels for this line.
is_quote: boolWhether this line is a blockquote.
is_code_block: boolWhether this line is part of a fenced code block.
is_thematic_break: boolWhether this line is a thematic divider break (—, ***, ___).
task_state: Option<bool>Whether this line is a task list item (Some(false) for unchecked, Some(true) for checked).
Implementations§
Source§impl LineMetrics
impl LineMetrics
Sourcepub fn for_line(
raw_line_text: &str,
_concealed_display_text: &str,
spans: &[StyleSpan],
base_font_size: Pixels,
base_line_height: Pixels,
) -> Self
pub fn for_line( raw_line_text: &str, _concealed_display_text: &str, spans: &[StyleSpan], base_font_size: Pixels, base_line_height: Pixels, ) -> Self
Calculates layout metrics and block-level decorations based on syntax spans and line text.
spans are the original (pre-concealment) highlight spans for the line. Structural
decorations (Blockquote, HorizontalRule, Task*) are detected solely via
HighlightTags so custom languages work without raw string checks. Code-block
detection relies on a full-line Code span rather than fence prefixes.
Trait Implementations§
Source§impl Clone for LineMetrics
impl Clone for LineMetrics
Source§fn clone(&self) -> LineMetrics
fn clone(&self) -> LineMetrics
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LineMetrics
impl RefUnwindSafe for LineMetrics
impl Send for LineMetrics
impl Sync for LineMetrics
impl Unpin for LineMetrics
impl UnsafeUnpin for LineMetrics
impl UnwindSafe for LineMetrics
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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