pub enum ComponentError {
ComponentFormatErrors(Vec<ComponentFormatError>),
}
Expand description
ComponentError
is a collection of errors in Component
.
For more information about Component
, see doc in ‘compiler_base/error/src/diagnostic/mod.rs’
and ‘compiler_base/error/src/diagnostic/components.rs’.
Currently ComponentError
only supports type ComponentFormatErrors
, and more types can be added later if needed.
§Examples
// If you want to new a `ComponentFormatError`,
let component_format_error_1 = ComponentFormatError::new("name_1", "The component_1 format failed.");
let component_format_error_2 = ComponentFormatError::new("name_2", "The component_1 format failed.");
let errs = vec![component_format_error_1, component_format_error_2];
let component_format_errors = ComponentError::ComponentFormatErrors(errs);
let errs_fmt = format!("{:?}", component_format_errors);
assert_eq!(
"ComponentFormatErrors([ComponentFormatError { name: \"name_1\", message: \"The component_1 format failed.\" }, ComponentFormatError { name: \"name_2\", message: \"The component_1 format failed.\" }])"
, errs_fmt)
Variants§
ComponentFormatErrors(Vec<ComponentFormatError>)
Trait Implementations§
Source§impl Debug for ComponentError
impl Debug for ComponentError
Source§impl Display for ComponentError
impl Display for ComponentError
Source§impl Error for ComponentError
impl Error for ComponentError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ComponentError
impl RefUnwindSafe for ComponentError
impl Send for ComponentError
impl Sync for ComponentError
impl Unpin for ComponentError
impl UnwindSafe for ComponentError
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> 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