pub enum ReadError {
UnexpectedEof {
offset: u32,
},
BadMagic {
expected: &'static str,
offset: u32,
},
VarintOverflow {
offset: u32,
},
ChunkOverrun {
offset: u32,
chunk_id: u32,
len: u32,
},
Strict(Diagnostic),
}Expand description
Something went wrong badly enough that parsing could not continue.
Variants§
UnexpectedEof
The buffer ended in the middle of a value that must be present.
BadMagic
The file’s magic string is not the one this loader expects.
Carries the expected magic; the observed bytes stay in the caller’s buffer.
Fields
VarintOverflow
A compressed integer ran past the format’s 5-byte cap.
ChunkOverrun
A chunk declared a length extending past the end of its parent.
Fields
Strict(Diagnostic)
Strict mode was requested and a recoverable problem was found.
The payload is deliberately flattened to the diagnostic’s own fields so this stays Copy.
Trait Implementations§
impl Copy for ReadError
impl Eq for ReadError
Source§impl Error for ReadError
impl Error for ReadError
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 ReadError
Auto Trait Implementations§
impl Freeze for ReadError
impl RefUnwindSafe for ReadError
impl Send for ReadError
impl Sync for ReadError
impl Unpin for ReadError
impl UnsafeUnpin for ReadError
impl UnwindSafe for ReadError
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