pub struct Diag {
pub code: &'static str,
pub message: String,
pub offset: Option<usize>,
}Expand description
A machine-readable diagnostic: used both for hard errors and node warnings.
code is a stable SCREAMING_SNAKE identifier (see docs/DESIGN.md);
offset is a byte offset into the buffer being decoded, when known.
Fields§
§code: &'static str§message: String§offset: Option<usize>Implementations§
Trait Implementations§
impl Eq for Diag
Source§impl Error for Diag
impl Error for Diag
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()
impl StructuralPartialEq for Diag
Auto Trait Implementations§
impl Forget for Diag
impl Freeze for Diag
impl Move for Diag
impl RefUnwindSafe for Diag
impl Send for Diag
impl Sync for Diag
impl Unpin for Diag
impl UnsafeUnpin for Diag
impl UnwindSafe for Diag
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