Skip to main content

Highlighter

Trait Highlighter 

Source
pub trait Highlighter:
    Send
    + Sync
    + 'static {
    // Required method
    fn highlight(
        &self,
        language: &str,
        code: &str,
        theme: &Theme,
    ) -> Arc<[Line<'static>]>;

    // Provided methods
    fn highlight_stable(
        &self,
        language: &str,
        code: &str,
        theme: &Theme,
    ) -> Arc<[Line<'static>]> { ... }
    fn cache_key(&self) -> u64 { ... }
}

Required Methods§

Source

fn highlight( &self, language: &str, code: &str, theme: &Theme, ) -> Arc<[Line<'static>]>

Provided Methods§

Source

fn highlight_stable( &self, language: &str, code: &str, theme: &Theme, ) -> Arc<[Line<'static>]>

Source

fn cache_key(&self) -> u64

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§