pub struct InternalError { /* private fields */ }Expand description
An internal failure retaining its source for trusted tracing.
Its default fmt::Display and fmt::Debug representations are
redacted. Converting this type into PublicError deliberately discards
the source.
Implementations§
Source§impl InternalError
impl InternalError
Sourcepub fn new(
incident_id: IncidentId,
scope: DefectScope,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn new( incident_id: IncidentId, scope: DefectScope, source: impl Error + Send + Sync + 'static, ) -> Self
Creates an internal failure associated with an opaque incident.
There is deliberately no scope default and no second constructor that omits it: a new defect path must decide what its defect implies rather than inherit an answer nobody made (ADR-0250 decision 1).
Sourcepub const fn scope(&self) -> DefectScope
pub const fn scope(&self) -> DefectScope
Returns what this defect puts in doubt.
Sourcepub const fn incident_id(&self) -> &IncidentId
pub const fn incident_id(&self) -> &IncidentId
Returns the opaque identifier used to correlate trusted diagnostics.
Sourcepub fn into_public(self) -> PublicError
pub fn into_public(self) -> PublicError
Converts this internal failure into a redacted public failure.
Trait Implementations§
Source§impl Debug for InternalError
impl Debug for InternalError
Source§impl Display for InternalError
impl Display for InternalError
Source§impl Error for InternalError
impl Error for InternalError
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<InternalError> for PublicError
impl From<InternalError> for PublicError
Source§fn from(error: InternalError) -> Self
fn from(error: InternalError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for InternalError
impl !UnwindSafe for InternalError
impl Freeze for InternalError
impl Send for InternalError
impl Sync for InternalError
impl Unpin for InternalError
impl UnsafeUnpin for InternalError
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