pub enum DiagnosticStyle {
Logo,
NeedFix,
NeedAttention,
Helpful,
Important,
Url,
}
Expand description
‘DiagnosticStyle’ defines all the styles that needed when displaying diagnostic message.
Variants§
Implementations§
Source§impl DiagnosticStyle
impl DiagnosticStyle
Sourcepub fn check_is_expected_colorspec(&self, spec: &ColorSpec) -> bool
pub fn check_is_expected_colorspec(&self, spec: &ColorSpec) -> bool
Check if a ColorSpec
is corresponding to the DiagnosticStyle
.
§Examples
let mut color_spec = DiagnosticStyle::NeedFix.render_style_to_color_spec();
assert!(DiagnosticStyle::NeedFix.check_is_expected_colorspec(&color_spec));
color_spec.set_bold(false);
assert!(!DiagnosticStyle::NeedFix.check_is_expected_colorspec(&color_spec));
Trait Implementations§
Source§impl Clone for DiagnosticStyle
impl Clone for DiagnosticStyle
Source§fn clone(&self) -> DiagnosticStyle
fn clone(&self) -> DiagnosticStyle
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Component<DiagnosticStyle> for CodeSnippet
impl Component<DiagnosticStyle> for CodeSnippet
Source§fn format(
&self,
sb: &mut StyledBuffer<DiagnosticStyle>,
errs: &mut Vec<ComponentFormatError>,
)
fn format( &self, sb: &mut StyledBuffer<DiagnosticStyle>, errs: &mut Vec<ComponentFormatError>, )
Source§impl Component<DiagnosticStyle> for Label
impl Component<DiagnosticStyle> for Label
Source§fn format(
&self,
sb: &mut StyledBuffer<DiagnosticStyle>,
_: &mut Vec<ComponentFormatError>,
)
fn format( &self, sb: &mut StyledBuffer<DiagnosticStyle>, _: &mut Vec<ComponentFormatError>, )
Source§impl Component<DiagnosticStyle> for StyledString<DiagnosticStyle>
impl Component<DiagnosticStyle> for StyledString<DiagnosticStyle>
Source§fn format(
&self,
sb: &mut StyledBuffer<DiagnosticStyle>,
_: &mut Vec<ComponentFormatError>,
)
fn format( &self, sb: &mut StyledBuffer<DiagnosticStyle>, _: &mut Vec<ComponentFormatError>, )
Source§impl Component<DiagnosticStyle> for UnderLine
impl Component<DiagnosticStyle> for UnderLine
Source§fn format(
&self,
sb: &mut StyledBuffer<DiagnosticStyle>,
errs: &mut Vec<ComponentFormatError>,
)
fn format( &self, sb: &mut StyledBuffer<DiagnosticStyle>, errs: &mut Vec<ComponentFormatError>, )
Source§impl Debug for DiagnosticStyle
impl Debug for DiagnosticStyle
Source§impl PartialEq for DiagnosticStyle
impl PartialEq for DiagnosticStyle
Source§impl Style for DiagnosticStyle
impl Style for DiagnosticStyle
Source§fn render_style_to_color_spec(&self) -> ColorSpec
fn render_style_to_color_spec(&self) -> ColorSpec
render style to terminal color/font configuration. Read more
impl Copy for DiagnosticStyle
impl Eq for DiagnosticStyle
impl StructuralPartialEq for DiagnosticStyle
Auto Trait Implementations§
impl Freeze for DiagnosticStyle
impl RefUnwindSafe for DiagnosticStyle
impl Send for DiagnosticStyle
impl Sync for DiagnosticStyle
impl Unpin for DiagnosticStyle
impl UnwindSafe for DiagnosticStyle
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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>
Converts
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>
Converts
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