pub enum FttsqError {
Show 20 variants
TooShort {
length: u64,
},
BadMagic {
found: [u8; 8],
},
UnsupportedVersion {
found: u32,
supported: u32,
},
DirectoryLength {
declared: u64,
limit: u64,
},
DirectoryMalformed {
detail: String,
},
Field {
path: String,
expected: String,
},
UnknownValue {
path: String,
found: String,
},
LimitExceeded {
what: String,
found: u64,
limit: u64,
},
RangeOutOfBounds {
what: String,
offset: u64,
length: u64,
bound: u64,
},
SectionOverlap {
first: String,
second: String,
},
TensorOverlap {
first: String,
second: String,
},
DuplicateName {
what: String,
name: String,
},
UnknownSection {
tensor: String,
section: String,
},
LengthMismatch {
tensor: String,
declared: u64,
implied: u64,
},
DigestMismatch {
section: String,
expected: String,
actual: String,
},
LicenseNoticeMissing,
SectionWriteOutOfOrder {
expected: Option<String>,
actual: String,
},
SectionLengthExceeded {
section: String,
declared: u64,
attempted: u64,
},
SectionIncomplete {
section: String,
declared: u64,
written: u64,
},
Io {
operation: String,
path: String,
detail: String,
},
}Expand description
What went wrong reading an artifact.
Every variant names the offending section, tensor, or offset: a refusal that does not say what it refused costs an hour of bisecting a multi-gigabyte file.
Variants§
TooShort
File is shorter than the fixed header prefix.
BadMagic
Magic bytes are not FTTSQ.
UnsupportedVersion
The artifact is newer than this binary understands.
DirectoryLength
The directory length is implausible or does not fit in the file.
DirectoryMalformed
The directory is not valid UTF-8 JSON, or is not an object.
Field
A required field is missing or the wrong type.
UnknownValue
An enum carried a value this binary does not know.
LimitExceeded
A declared count or dimension exceeds its cap.
RangeOutOfBounds
A byte range overflowed or ran past the end of its container.
Fields
SectionOverlap
Two sections claim overlapping bytes.
TensorOverlap
Two tensors in one section claim overlapping bytes.
DuplicateName
A name is declared twice.
UnknownSection
A tensor references a section that does not exist.
LengthMismatch
A tensor’s declared length disagrees with its shape and dtype.
Fields
DigestMismatch
A section’s bytes do not match its recorded digest.
Fields
LicenseNoticeMissing
The mandatory license notice is absent or empty.
Apache-2.0 §4 attaches to every artifact we publish; an artifact without the notice must not be readable, or the obligation becomes advisory in practice.
SectionWriteOutOfOrder
A streaming writer received bytes for a section other than the next declared one.
Fields
SectionLengthExceeded
A streaming writer was given more bytes than its declared section length.
Fields
SectionIncomplete
A streaming writer was finalized before its current section was complete.
Fields
Io
A filesystem operation failed.
Carries the rendered message rather than std::io::Error so this enum stays Clone and
PartialEq — properties the tests and the fuzz target rely on.
Trait Implementations§
Source§impl Clone for FttsqError
impl Clone for FttsqError
Source§fn clone(&self) -> FttsqError
fn clone(&self) -> FttsqError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FttsqError
impl Debug for FttsqError
Source§impl Display for FttsqError
impl Display for FttsqError
impl Eq for FttsqError
Source§impl Error for FttsqError
impl Error for FttsqError
1.30.0 · 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()