Skip to main content

FttsqError

Enum FttsqError 

Source
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.

Fields

§length: u64

Bytes actually present.

§

BadMagic

Magic bytes are not FTTSQ.

Fields

§found: [u8; 8]

The first eight bytes found.

§

UnsupportedVersion

The artifact is newer than this binary understands.

Fields

§found: u32

Version recorded in the file.

§supported: u32

Newest version this binary reads.

§

DirectoryLength

The directory length is implausible or does not fit in the file.

Fields

§declared: u64

Declared length.

§limit: u64

Cap or file length it violated.

§

DirectoryMalformed

The directory is not valid UTF-8 JSON, or is not an object.

Fields

§detail: String

What the parser said.

§

Field

A required field is missing or the wrong type.

Fields

§path: String

JSON path of the field.

§expected: String

What was expected.

§

UnknownValue

An enum carried a value this binary does not know.

Fields

§path: String

JSON path of the field.

§found: String

The unrecognized value.

§

LimitExceeded

A declared count or dimension exceeds its cap.

Fields

§what: String

What was being counted.

§found: u64

Declared value.

§limit: u64

The cap.

§

RangeOutOfBounds

A byte range overflowed or ran past the end of its container.

Fields

§what: String

What the range belongs to.

§offset: u64

Start offset.

§length: u64

Length.

§bound: u64

The bound it violated.

§

SectionOverlap

Two sections claim overlapping bytes.

Fields

§first: String

The earlier section.

§second: String

The later section.

§

TensorOverlap

Two tensors in one section claim overlapping bytes.

Fields

§first: String

The earlier tensor.

§second: String

The later tensor.

§

DuplicateName

A name is declared twice.

Fields

§what: String

What kind of thing.

§name: String

The repeated name.

§

UnknownSection

A tensor references a section that does not exist.

Fields

§tensor: String

The tensor.

§section: String

The section it named.

§

LengthMismatch

A tensor’s declared length disagrees with its shape and dtype.

Fields

§tensor: String

The tensor.

§declared: u64

Length the directory declared.

§implied: u64

Length implied by shape and dtype.

§

DigestMismatch

A section’s bytes do not match its recorded digest.

Fields

§section: String

The section.

§expected: String

Digest the directory recorded.

§actual: String

Digest the bytes actually produce.

§

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

§expected: Option<String>

Section the stream expected next, or None once all sections are complete.

§actual: String

Section the caller attempted to write.

§

SectionLengthExceeded

A streaming writer was given more bytes than its declared section length.

Fields

§section: String

Section receiving bytes.

§declared: u64

Length fixed in the conversion plan.

§attempted: u64

Total bytes the write would have produced.

§

SectionIncomplete

A streaming writer was finalized before its current section was complete.

Fields

§section: String

Section still awaiting bytes.

§declared: u64

Length fixed in the conversion plan.

§written: u64

Bytes successfully written so far.

§

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.

Fields

§operation: String

What was being attempted.

§path: String

The path involved.

§detail: String

The OS error text.

Trait Implementations§

Source§

impl Clone for FttsqError

Source§

fn clone(&self) -> FttsqError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FttsqError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for FttsqError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for FttsqError

Source§

impl Error for FttsqError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for FttsqError

Source§

fn eq(&self, other: &FttsqError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FttsqError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.