#[non_exhaustive]pub enum Error {
Show 24 variants
Io(Error),
Core(Error),
UnexpectedEof,
InvalidHeader(String),
MultiBufferLengthMismatch {
declared: usize,
actual: usize,
},
BufferSizeMismatch {
index: usize,
declared: u64,
actual: u64,
},
FrameTooLarge {
kind: &'static str,
value: u64,
limit: u64,
},
InvalidCrossMachineSyncMode {
index: usize,
actual: u8,
},
TornComposite {
declared: u32,
actual: u32,
},
CompositeNestingTooDeep {
limit: usize,
},
NotAComposite(String),
InvalidFileMagic,
InvalidTrailerMagic,
UnsupportedContainerVersion {
major: u8,
},
TensorNotFound(String),
DuplicateTensorName(String),
TensorNameEmpty,
TensorNameTooLong {
len: usize,
},
IndexCrc32cMismatch {
stored: u32,
computed: u32,
},
DuplicateKvKey(String),
KvKeyEmpty,
KvKeyTooLong {
len: usize,
},
ReservedFileFlagBits {
flags: u32,
},
IndexOverrunsTrailer,
}Expand description
Crate-level error type for hurray-io.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
An I/O error from the underlying stream or file.
Core(Error)
A core format error.
UnexpectedEof
The stream ended before a complete record was read.
InvalidHeader(String)
A frame or record header is malformed.
MultiBufferLengthMismatch
The number of supplied buffer slices does not match the descriptor’s buffer table.
BufferSizeMismatch
A supplied buffer’s byte length does not match the corresponding handle’s byte_size.
FrameTooLarge
A descriptor or buffer exceeded the configured size limit.
InvalidCrossMachineSyncMode
A buffer handle’s sync_mode is invalid for a cross-machine transport.
TornComposite
A composite head’s members were truncated: the stream ended before the head’s
declared member_count members had been read.
CompositeNestingTooDeep
Composite nesting exceeded the configured maximum depth. Guards against stack exhaustion from a maliciously deep composite on an untrusted stream.
NotAComposite(String)
A composite read was requested for a tensor whose head is not a composite.
InvalidFileMagic
The file header magic is not HRRYFILE.
InvalidTrailerMagic
The trailer magic is not HRRY.
UnsupportedContainerVersion
The container major version is higher than this reader supports.
TensorNotFound(String)
A tensor name was requested but is not in the file index.
DuplicateTensorName(String)
Two tensors in the same file share a name.
TensorNameEmpty
A tensor name is empty.
TensorNameTooLong
A tensor name exceeds the 65 535-byte uint16 limit.
IndexCrc32cMismatch
The index CRC-32C does not match the stored value.
DuplicateKvKey(String)
Two KV entries share the same key.
KvKeyEmpty
A KV key is empty.
KvKeyTooLong
A KV key exceeds the 65 535-byte uint16 limit.
ReservedFileFlagBits
A reserved flag bit was set in the file header.
IndexOverrunsTrailer
The index section overlaps the trailer.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()