pub struct Error { /* private fields */ }Expand description
A framework error containing a structured diagnostic and optional cause.
Implementations§
Source§impl Error
impl Error
Sourcepub fn new(diagnostic: Diagnostic) -> Self
pub fn new(diagnostic: Diagnostic) -> Self
Creates an error from a structured diagnostic.
Sourcepub fn from_diagnostics(
primary: Diagnostic,
related: impl IntoIterator<Item = Diagnostic>,
) -> Self
pub fn from_diagnostics( primary: Diagnostic, related: impl IntoIterator<Item = Diagnostic>, ) -> Self
Creates an error from a primary diagnostic and ordered related diagnostics.
Sourcepub fn with_source<E>(diagnostic: Diagnostic, source: E) -> Self
pub fn with_source<E>(diagnostic: Diagnostic, source: E) -> Self
Creates an error from a structured diagnostic and an underlying cause.
Sourcepub fn code(&self) -> DiagnosticCode
pub fn code(&self) -> DiagnosticCode
Returns this error’s stable diagnostic code.
Sourcepub fn diagnostic(&self) -> &Diagnostic
pub fn diagnostic(&self) -> &Diagnostic
Returns the structured diagnostic carried by this error.
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
return every diagnostic in deterministic report order.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<ConfigurationErrors> for Error
impl From<ConfigurationErrors> for Error
Source§fn from(errors: ConfigurationErrors) -> Self
fn from(errors: ConfigurationErrors) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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