pub struct PostcardError {
pub code: i32,
pub pos: usize,
pub message: String,
pub source_bytes: Option<Vec<u8>>,
}Expand description
Postcard parsing error with optional source context for diagnostics.
Fields§
§code: i32Error code from JIT
pos: usizePosition in input where error occurred
message: StringHuman-readable message
source_bytes: Option<Vec<u8>>Optional source bytes for diagnostics (hex dump context)
Implementations§
Source§impl PostcardError
impl PostcardError
Sourcepub fn with_source(self, bytes: &[u8]) -> Self
pub fn with_source(self, bytes: &[u8]) -> Self
Attach source bytes for richer diagnostics.
Trait Implementations§
Source§impl Clone for PostcardError
impl Clone for PostcardError
Source§fn clone(&self) -> PostcardError
fn clone(&self) -> PostcardError
Returns a duplicate of the value. Read more
1.0.0 · 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 PostcardError
impl Debug for PostcardError
Source§impl Display for PostcardError
impl Display for PostcardError
Source§impl Error for PostcardError
impl Error for PostcardError
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()
Auto Trait Implementations§
impl Freeze for PostcardError
impl RefUnwindSafe for PostcardError
impl Send for PostcardError
impl Sync for PostcardError
impl Unpin for PostcardError
impl UnsafeUnpin for PostcardError
impl UnwindSafe for PostcardError
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