Skip to main content

WriteStyle

Trait WriteStyle 

Source
pub trait WriteStyle: GeneralWrite {
    // Required methods
    fn set_header(&mut self, severity: Severity) -> GeneralWriteResult;
    fn set_header_message(&mut self) -> GeneralWriteResult;
    fn set_line_number(&mut self) -> GeneralWriteResult;
    fn set_note_bullet(&mut self) -> GeneralWriteResult;
    fn set_source_border(&mut self) -> GeneralWriteResult;
    fn set_label(
        &mut self,
        severity: Severity,
        label_style: LabelStyle,
    ) -> GeneralWriteResult;
    fn reset(&mut self) -> GeneralWriteResult;
}
Expand description

A writer that can apply styling for different parts of a diagnostic renderer.

§Implementations

  • PlainWriter<W> - no-op styling, plain text output
  • StylesWriter<W> - custom styles (requires termcolor feature)
  • T: WriteColor - blanket impl using default styles (requires termcolor feature)

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl WriteStyle for Renderer<'_, '_>

Source§

impl<T> WriteStyle for T
where T: WriteColor + ?Sized,

Available on crate feature termcolor only.
Source§

impl<W: WriteColor> WriteStyle for StylesWriter<'_, W>