#[non_exhaustive]pub enum Error {
Show 31 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,
},
UnallocatableBuffer {
index: usize,
byte_size: u64,
alignment: u32,
},
TornComposite {
declared: u32,
actual: u32,
},
CompositeNestingTooDeep {
limit: usize,
},
NotAComposite(String),
CoreUnusable(Unusable),
CoreFailed,
InvalidProgressReport {
reported: usize,
offered: usize,
},
ZeroLengthWrite,
SinkClosed,
HeaderNotWritten,
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.
UnallocatableBuffer
A buffer handle’s declared size and alignment do not form an allocatable layout on
this host (a byte_size beyond the address space, or a non-power-of-two alignment).
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.
CoreUnusable(Unusable)
The core was marked unusable: a transport moved bytes whose count was lost, so the core’s position no longer matches the transport’s.
CoreFailed
A previous call returned an error and this core cannot continue. Distinct from
Error::CoreUnusable: the position is known, the stream is simply over.
InvalidProgressReport
A driver reported more bytes than the core offered it.
ZeroLengthWrite
A driver reported a zero-length write, which is never progress.
SinkClosed
The sink was closed while an item was in flight, so a truncated item is on the wire. The core and the sink are both poisoned.
HeaderNotWritten
A tensor or footer was submitted to a file writer core before its header.
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()