[][src]Trait annotate_snippets::formatter::style::Style

pub trait Style {
    fn paint(&self, text: &str, f: &mut Formatter) -> Result;
fn paint_fn<'a>(
        &self,
        c: Box<dyn FnOnce(&mut Formatter) -> Result + 'a>,
        f: &mut Formatter
    ) -> Result;
fn bold(&self) -> Box<dyn Style>; }

This trait implements a return value for the Stylesheet::get_style.

Required methods

fn paint(&self, text: &str, f: &mut Formatter) -> Result

The method used to write text with formatter

fn paint_fn<'a>(
    &self,
    c: Box<dyn FnOnce(&mut Formatter) -> Result + 'a>,
    f: &mut Formatter
) -> Result

The method used to write display function with formatter

fn bold(&self) -> Box<dyn Style>

The method used by the DisplayListFormatter to display the message in bold font.

Loading content...

Implementors

impl Style for NoOpStyle[src]

Loading content...