pub struct ErrorSourceDiagnostics { /* private fields */ }Expand description
Human diagnostics derived from an error source chain.
Retained query diagnostics should keep machine-readable fields (code,
kind, status, operation, facts) separate from human root-cause text.
This formatter walks std::error::Error::source() and renders each project
error by its human message. Structured Display output is not used. Each
layer’s text is capped at MAX_SOURCE_CHAIN_MESSAGE_BYTES and the joined
chain at MAX_SOURCE_CHAIN_BYTES, both with ... markers; the in-process
error is never rewritten. Server-side logs should use ErrorLogDiagnostics.
Implementations§
Source§impl ErrorSourceDiagnostics
impl ErrorSourceDiagnostics
Sourcepub fn from_error(error: &(dyn StdError + 'static)) -> Self
pub fn from_error(error: &(dyn StdError + 'static)) -> Self
Builds diagnostics from error and all of its sources.
Sourcepub fn from_source(source: Option<&(dyn StdError + 'static)>) -> Self
pub fn from_source(source: Option<&(dyn StdError + 'static)>) -> Self
Builds diagnostics from an optional source, excluding the wrapper that already has explicit machine fields at the current boundary.
Sourcepub fn chain(&self) -> Option<&str>
pub fn chain(&self) -> Option<&str>
Full source chain text, with adjacent duplicate messages removed.
Sourcepub fn root_cause(&self) -> Option<&str>
pub fn root_cause(&self) -> Option<&str>
Deepest source message.
Sourcepub fn root_cause_when_distinct(&self) -> Option<&str>
pub fn root_cause_when_distinct(&self) -> Option<&str>
Deepest source message when it adds information beyond the full chain.
Trait Implementations§
Source§impl Clone for ErrorSourceDiagnostics
impl Clone for ErrorSourceDiagnostics
Source§impl Debug for ErrorSourceDiagnostics
impl Debug for ErrorSourceDiagnostics
impl Eq for ErrorSourceDiagnostics
Source§impl PartialEq for ErrorSourceDiagnostics
impl PartialEq for ErrorSourceDiagnostics
impl StructuralPartialEq for ErrorSourceDiagnostics
Auto Trait Implementations§
impl Freeze for ErrorSourceDiagnostics
impl RefUnwindSafe for ErrorSourceDiagnostics
impl Send for ErrorSourceDiagnostics
impl Sync for ErrorSourceDiagnostics
impl Unpin for ErrorSourceDiagnostics
impl UnsafeUnpin for ErrorSourceDiagnostics
impl UnwindSafe for ErrorSourceDiagnostics
Blanket Implementations§
impl<T> Allocation for T
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<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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request