pub struct DecodeError {
pub offset: usize,
pub reason: Reason,
pub address: Option<u32>,
}Expand description
Nibbles that are not an object, and where they stop being one.
offset is in the coordinates of the function that failed: the nibble
index into the slice given to crate::decode, crate::prolog’s
walks, crate::Real::from_body and crate::Integer::from_nibbles;
for an object read from memory (crate::decode_at, a ROM pointer’s
target) the nibble index from the start of the object at address.
For the budget reasons (Reason::TooManyObjects and the like) the
offset is 0: the budget covers the whole decode.
Fields§
§offset: usizeNibble offset where decoding failed (see above).
reason: ReasonWhy.
address: Option<u32>The memory address of the object offset counts in, when it was
read from memory; None when offset indexes the caller’s slice.
Implementations§
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
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 From<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(e: DecodeError) -> Self
fn from(e: DecodeError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
impl StructuralPartialEq for DecodeError
Auto Trait Implementations§
impl Freeze for DecodeError
impl RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnsafeUnpin for DecodeError
impl UnwindSafe for DecodeError
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