Skip to main content

Highlighter

Trait Highlighter 

Source
pub trait Highlighter {
    // Required method
    fn highlight(&self, text: &mut Text);
}
Expand description

A transformer that adds style spans to Text (e.g. syntax/number/URL highlighting). The Rust equivalent of upstream’s Highlighter ABC.

This is the primary plugin seam for the first slice: rich-ext registers Highlighters onto a Console without the core knowing they exist.

Required Methods§

Source

fn highlight(&self, text: &mut Text)

Inspect text and apply any style spans in place.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§