pub enum FormatError {
Io(Error),
BadMagic([u8; 4]),
BadTrailerMagic([u8; 4]),
UnsupportedVersion(u16),
Truncated,
TooLarge,
InvalidUtf8,
ChecksumMismatch {
stored: u64,
computed: u64,
},
Corrupt(&'static str),
}Expand description
Errors produced while reading or writing .rec data.
Malformed input is reported through these variants and never panics.
Variants§
Io(Error)
An underlying I/O operation failed.
BadMagic([u8; 4])
The file does not start with the TKWS magic.
BadTrailerMagic([u8; 4])
The file does not end with the TKWE trailer magic.
UnsupportedVersion(u16)
The file was written by a newer format version than this build reads.
Truncated
The data ends before a complete structure could be read.
TooLarge
A declared length exceeds the format’s safety limits.
InvalidUtf8
A string field holds bytes that are not valid UTF-8.
ChecksumMismatch
The stored checksum does not match the recomputed one.
Fields
Corrupt(&'static str)
A structural invariant does not hold, with a short reason.
Trait Implementations§
Source§impl Debug for FormatError
impl Debug for FormatError
Source§impl Display for FormatError
impl Display for FormatError
Source§impl Error for FormatError
impl Error for FormatError
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<Error> for FormatError
impl From<Error> for FormatError
Source§impl From<FormatError> for CompareError
impl From<FormatError> for CompareError
Source§fn from(err: FormatError) -> Self
fn from(err: FormatError) -> Self
Converts to this type from the input type.
Source§impl From<FormatError> for DiffError
impl From<FormatError> for DiffError
Source§fn from(err: FormatError) -> Self
fn from(err: FormatError) -> Self
Converts to this type from the input type.
Source§impl From<FormatError> for RecordError
impl From<FormatError> for RecordError
Source§fn from(err: FormatError) -> Self
fn from(err: FormatError) -> Self
Converts to this type from the input type.
Source§impl From<FormatError> for ReplayError
impl From<FormatError> for ReplayError
Source§fn from(err: FormatError) -> Self
fn from(err: FormatError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for FormatError
impl !UnwindSafe for FormatError
impl Freeze for FormatError
impl Send for FormatError
impl Sync for FormatError
impl Unpin for FormatError
impl UnsafeUnpin for FormatError
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