Skip to main content

ConsoleCodeHighlighting

Trait ConsoleCodeHighlighting 

Source
pub trait ConsoleCodeHighlighting {
    // Required methods
    fn set_code_highlighting(&mut self, value: Option<CodeHighlighting>);
    fn code_highlighting(&self) -> Option<&CodeHighlighting>;
}
Expand description

Attach/query a console’s default code highlighter.

A Syntax without a highlighter of its own, and so Markdown code blocks, highlights with the console’s when it renders; the console’s theme applies when the Syntax names none. Without one, the default SyntectHighlighter is used, as before: upstream has no such setting. In a build with core’s code feature but not syntax there is no default engine, and this is how code gets highlighted at all; without one, code renders plain.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§