Skip to main content

Highlighter

Trait Highlighter 

pub trait Highlighter<Input, Theme = Theme> {
    // Required methods
    fn id(&self) -> &str;
    fn highlight(&self, input: Input, theme: &Theme) -> Style;
}
Available on crate feature markdown only.
Expand description

A type that describes how to highlight an Input with some Style.

Required Methods§

fn id(&self) -> &str

A unique identifier for the highlighter.

fn highlight(&self, input: Input, theme: &Theme) -> Style

Returns the Style of the given Input.

Implementors§

§

impl<T, Input, Theme> Highlighter<Input, Theme> for T
where T: Fn(Input, &Theme) -> Style,