Skip to main content

SyntaxTheme

Trait SyntaxTheme 

Source
pub trait SyntaxTheme {
    // Required methods
    fn get_style(&self, token: &str) -> Option<Style>;
    fn background_color(&self) -> Option<Color>;
}
Expand description

Trait for syntax themes.

Implementors provide token-to-style mappings and an optional background color for syntax-highlighted code blocks.

Required Methods§

Source

fn get_style(&self, token: &str) -> Option<Style>

Get the style for a given token type (e.g. "keyword", "string").

Source

fn background_color(&self) -> Option<Color>

Get the optional background color for the entire code block.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§