Struct diagnostic::Config
source · pub struct Config {
pub color_enable: bool,
pub margin_color: Option<(Color, Color)>,
pub unimportant_color: Option<Color>,
pub characters: Characters,
/* private fields */
}Expand description
A type used to configure a report
Fields§
§color_enable: boolis enable
margin_color: Option<(Color, Color)>custom margin color
unimportant_color: Option<Color>custom important
characters: CharactersCustom character sets
Implementations§
source§impl Config
impl Config
sourcepub fn with_cross_gap(self, cross_gap: bool) -> Self
pub fn with_cross_gap(self, cross_gap: bool) -> Self
When label lines cross one-another, should there be a gap?
The alternative to this is to insert crossing characters. However, these interact poorly with label colours.
If unspecified, this defaults to false.
sourcepub fn with_label_attach(self, label_attach: LabelAttach) -> Self
pub fn with_label_attach(self, label_attach: LabelAttach) -> Self
Where should inline labels attach to their spans?
If unspecified, this defaults to LabelAttach::Middle.
sourcepub fn with_compact(self, compact: bool) -> Self
pub fn with_compact(self, compact: bool) -> Self
Should the report remove gaps to minimise used space?
If unspecified, this defaults to false.
sourcepub fn with_underlines(self, underlines: bool) -> Self
pub fn with_underlines(self, underlines: bool) -> Self
Should underlines be used for label span where possible?
If unspecified, this defaults to true.
sourcepub fn with_multiline_arrows(self, multiline_arrows: bool) -> Self
pub fn with_multiline_arrows(self, multiline_arrows: bool) -> Self
Should arrows be used to point to the bounds of multi-line spans?
If unspecified, this defaults to true.
sourcepub fn with_color(self, color: bool) -> Self
pub fn with_color(self, color: bool) -> Self
Should colored output should be enabled?
If unspecified, this defaults to true.
sourcepub fn with_tab_width(self, tab_width: usize) -> Self
pub fn with_tab_width(self, tab_width: usize) -> Self
How many characters width should tab characters be?
If unspecified, this defaults to 4.
sourcepub fn with_characters(self, set: impl CharacterSet) -> Self
pub fn with_characters(self, set: impl CharacterSet) -> Self
What character set should be used to display dynamic elements such as boxes and arrows?
If unspecified, this defaults to BuiltinSymbol::Unicode.