Trait PygmentizeFormatter

Source
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§

Source

const SHORT_NAME: &'static str

Required Methods§

Source

fn options_str(&self) -> Option<Cow<'_, str>>

Provided Methods§

Source

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.

Implementors§