pub struct Diagnostic { /* private fields */ }Implementations§
Source§impl Diagnostic
impl Diagnostic
pub fn new(kind: DiagnosticKind, message: impl Into<String>) -> Diagnostic
pub fn with_primary_span(self, span: Option<SourceSpan>) -> Diagnostic
pub fn with_secondary_span( self, label: impl Into<String>, span: SourceSpan, ) -> Diagnostic
pub fn with_frame(self, frame: DiagnosticFrame) -> Diagnostic
pub fn with_outer_frame(self, frame: DiagnosticFrame) -> Diagnostic
pub fn with_detail( self, key: impl Into<String>, value: impl Into<String>, ) -> Diagnostic
pub const fn kind(&self) -> DiagnosticKind
pub const fn category(&self) -> DiagnosticCategory
pub const fn retryable(&self) -> bool
pub fn message(&self) -> &str
pub fn primary_span(&self) -> Option<&SourceSpan>
pub fn secondary_spans(&self) -> &[SecondarySpan]
pub fn frames(&self) -> &[DiagnosticFrame]
pub fn details(&self) -> &[DiagnosticDetail]
pub const fn cause(&self) -> Option<DiagnosticKind>
pub fn with_cause(self, cause: DiagnosticKind) -> Diagnostic
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Diagnostic
impl Debug for Diagnostic
Source§impl Display for Diagnostic
impl Display for Diagnostic
impl Eq for Diagnostic
Source§impl Error for Diagnostic
impl Error for Diagnostic
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()
Source§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
impl StructuralPartialEq for Diagnostic
Auto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnsafeUnpin for Diagnostic
impl UnwindSafe for Diagnostic
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<T> CompactArcDrop for T
impl<T> CompactArcDrop for T
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.