pub trait PygmentizeFormatter: Sized {
const SHORT_NAME: &'static str;
// Required method
fn options_str(&self) -> Option<Cow<'_, str>>;
// Provided method
fn highlight(
&self,
code: impl AsRef<str>,
lang: Option<&str>,
) -> Result<String, PygmentizeError> { ... }
}
Expand description
Want to implement a formatter or add unsupported options?
See https://pygments.org/docs/formatters/ for available formatters.
Required Associated Constants§
const SHORT_NAME: &'static str
Required Methods§
fn options_str(&self) -> Option<Cow<'_, str>>
Provided Methods§
fn highlight( &self, code: impl AsRef<str>, lang: Option<&str>, ) -> Result<String, PygmentizeError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.