StyleSheet

Trait StyleSheet 

Source
pub trait StyleSheet:
    Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn heading(&self, level: u8) -> Style;
    fn code(&self) -> Style;
    fn link(&self) -> Style;
    fn blockquote(&self) -> Style;
    fn heading_meta(&self) -> Style;
    fn metadata_block(&self) -> Style;
}
Expand description

A collection of ratatui_core::style::Styles consumed by the renderer.

The trait purposefully stays tiny: whenever the renderer needs a color choice we add a new getter here. The default implementation maintains full backward-compatibility with the styles that lived in the old mod styles.

Required Methods§

Source

fn heading(&self, level: u8) -> Style

Style for a Markdown heading.

level is one-based (1 for # H1, …).

Source

fn code(&self) -> Style

Style for inline code spans and fenced code blocks when syntax highlighting is disabled.

Style for the text of an inline or reference link.

Source

fn blockquote(&self) -> Style

Base style applied to blockquotes (> prefix and body text).

Source

fn heading_meta(&self) -> Style

Style for heading attribute metadata appended to the heading text.

Source

fn metadata_block(&self) -> Style

Style for metadata blocks (front matter).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§