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§
Sourcefn get_style(&self, token: &str) -> Option<Style>
fn get_style(&self, token: &str) -> Option<Style>
Get the style for a given token type (e.g. "keyword", "string").
Sourcefn background_color(&self) -> Option<Color>
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".