pub struct DisplayDiagnosticConfig { /* private fields */ }Expand description
Configuration for rendering diagnostics.
Implementations§
Source§impl DisplayDiagnosticConfig
impl DisplayDiagnosticConfig
pub fn new(program: &'static str) -> DisplayDiagnosticConfig
Sourcepub fn format(self, format: DiagnosticFormat) -> DisplayDiagnosticConfig
pub fn format(self, format: DiagnosticFormat) -> DisplayDiagnosticConfig
Whether to enable concise diagnostic output or not.
Sourcepub fn color(self, yes: bool) -> DisplayDiagnosticConfig
pub fn color(self, yes: bool) -> DisplayDiagnosticConfig
Whether to enable colors or not.
Sourcepub fn hyperlinks(self, mode: HyperlinkMode) -> DisplayDiagnosticConfig
pub fn hyperlinks(self, mode: HyperlinkMode) -> DisplayDiagnosticConfig
Configures hyperlink rendering for colored diagnostic output.
Sourcepub fn anonymized_line_numbers(self, yes: bool) -> DisplayDiagnosticConfig
pub fn anonymized_line_numbers(self, yes: bool) -> DisplayDiagnosticConfig
Whether to anonymize line numbers in full diagnostic output.
Sourcepub fn context(self, lines: usize) -> DisplayDiagnosticConfig
pub fn context(self, lines: usize) -> DisplayDiagnosticConfig
Set the number of contextual lines to show around each snippet.
Sourcepub fn preview(self, yes: bool) -> DisplayDiagnosticConfig
pub fn preview(self, yes: bool) -> DisplayDiagnosticConfig
Whether to enable preview behavior or not.
pub fn preview_enabled(&self) -> bool
Sourcepub fn prefer_rule_codes(self, yes: bool) -> DisplayDiagnosticConfig
pub fn prefer_rule_codes(self, yes: bool) -> DisplayDiagnosticConfig
Whether to prefer rule codes over human-readable rule names, even in preview mode.
Sourcepub fn is_prefer_rule_codes_enabled(&self) -> bool
pub fn is_prefer_rule_codes_enabled(&self) -> bool
Whether rule codes are explicitly preferred over human-readable rule names.
Sourcepub fn hide_severity(self, yes: bool) -> DisplayDiagnosticConfig
pub fn hide_severity(self, yes: bool) -> DisplayDiagnosticConfig
Whether to hide a diagnostic’s severity or not.
Sourcepub fn with_show_fix_status(self, yes: bool) -> DisplayDiagnosticConfig
pub fn with_show_fix_status(self, yes: bool) -> DisplayDiagnosticConfig
Whether to show a fix’s availability or not.
Sourcepub fn with_fix_applicability(
self,
applicability: Applicability,
) -> DisplayDiagnosticConfig
pub fn with_fix_applicability( self, applicability: Applicability, ) -> DisplayDiagnosticConfig
Set the lowest fix applicability that should be shown.
In other words, an applicability of Safe (the default) would suppress showing fixes or fix
availability for unsafe or display-only fixes.
Note that this option is currently ignored when hide_severity is false.
pub fn show_fix_status(&self) -> bool
pub fn fix_applicability(&self) -> Applicability
pub fn with_cancellation_token( self, token: Option<CancellationToken>, ) -> DisplayDiagnosticConfig
Trait Implementations§
Source§impl Clone for DisplayDiagnosticConfig
impl Clone for DisplayDiagnosticConfig
Source§fn clone(&self) -> DisplayDiagnosticConfig
fn clone(&self) -> DisplayDiagnosticConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DisplayDiagnosticConfig
impl RefUnwindSafe for DisplayDiagnosticConfig
impl Send for DisplayDiagnosticConfig
impl Sync for DisplayDiagnosticConfig
impl Unpin for DisplayDiagnosticConfig
impl UnsafeUnpin for DisplayDiagnosticConfig
impl UnwindSafe for DisplayDiagnosticConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more