Skip to main content

UnidicArtifactPayloadError

Enum UnidicArtifactPayloadError 

Source
pub enum UnidicArtifactPayloadError {
Show 26 variants Io(Error), Yaml(Error), InvalidBinaryMagic { magic: [u8; 8], }, UnsupportedBinaryVersion { version: u32, }, NonZeroBinaryReserved { value: u32, }, TruncatedBinary { field: &'static str, }, InvalidBinaryUtf8 { field: &'static str, source: FromUtf8Error, }, BinaryValueTooLarge { field: &'static str, len: usize, }, BinaryEntryCountTooLarge { entries: u64, }, ArtifactLimitExceeded { field: &'static str, len: u64, max: u64, }, InvalidIndexedMagic { magic: [u8; 8], }, UnsupportedIndexedVersion { version: u32, }, NonZeroIndexedReserved { value: u32, }, TruncatedIndexed { field: &'static str, }, InvalidIndexedFst { message: String, }, IndexedSectionTooLarge { field: &'static str, len: u64, }, InvalidIndexedOffset { offset: u64, }, InvalidIndexedUtf8 { field: &'static str, source: Utf8Error, }, IndexedEntryCountMismatch { header_entries: usize, fst_entries: usize, }, UnsupportedSchemaVersion { version: u32, }, UnsupportedPayloadType { payload_type: String, }, EmptySurface { entry_index: usize, }, DuplicateSurface { surface: String, }, EmptyReadings { surface: String, }, EmptyReading { surface: String, reading_index: usize, }, DuplicateReading { surface: String, reading: String, },
}
Expand description

Errors returned while reading or validating UniDic artifact payloads.

Variants§

§

Io(Error)

Filesystem or reader error.

§

Yaml(Error)

YAML parser error.

§

InvalidBinaryMagic

Binary payload magic did not match the expected value.

Fields

§magic: [u8; 8]

Magic bytes read from the payload.

§

UnsupportedBinaryVersion

Binary payload version is not supported.

Fields

§version: u32

Version read from the payload.

§

NonZeroBinaryReserved

Reserved binary header field was non-zero.

Fields

§value: u32

Reserved value read from the payload.

§

TruncatedBinary

Binary payload ended before a field could be read.

Fields

§field: &'static str

Field being read.

§

InvalidBinaryUtf8

Binary payload contained invalid UTF-8.

Fields

§field: &'static str

Field being decoded.

§source: FromUtf8Error

UTF-8 conversion error.

§

BinaryValueTooLarge

Binary field length exceeded supported bounds.

Fields

§field: &'static str

Field being read.

§len: usize

Field length.

§

BinaryEntryCountTooLarge

Binary payload entry count exceeded supported bounds.

Fields

§entries: u64

Entry count read from the payload.

§

ArtifactLimitExceeded

Artifact payload exceeded a configured safety limit.

Fields

§field: &'static str

Field whose length or count exceeded the limit.

§len: u64

Observed length or count.

§max: u64

Maximum allowed length or count.

§

InvalidIndexedMagic

Indexed payload magic did not match the expected value.

Fields

§magic: [u8; 8]

Magic bytes read from the payload.

§

UnsupportedIndexedVersion

Indexed payload version is not supported.

Fields

§version: u32

Version read from the payload.

§

NonZeroIndexedReserved

Reserved indexed header field was non-zero.

Fields

§value: u32

Reserved value read from the payload.

§

TruncatedIndexed

Indexed payload ended before a section could be read.

Fields

§field: &'static str

Field or section being read.

§

InvalidIndexedFst

Indexed payload contained an invalid FST section.

Fields

§message: String

FST error message.

§

IndexedSectionTooLarge

Indexed payload section length exceeded supported bounds.

Fields

§field: &'static str

Section name.

§len: u64

Section length.

§

InvalidIndexedOffset

Indexed payload referenced an invalid readings offset.

Fields

§offset: u64

Offset read from the FST value.

§

InvalidIndexedUtf8

Indexed payload contained invalid UTF-8.

Fields

§field: &'static str

Field being decoded.

§source: Utf8Error

UTF-8 conversion error.

§

IndexedEntryCountMismatch

Indexed header entry count disagreed with the FST entry count.

Fields

§header_entries: usize

Entry count recorded in the header.

§fst_entries: usize

Entry count decoded from the FST.

§

UnsupportedSchemaVersion

YAML payload schema version is not supported.

Fields

§version: u32

Version read from the payload.

§

UnsupportedPayloadType

YAML payload type is not a UniDic reading index.

Fields

§payload_type: String

Payload type read from the payload.

§

EmptySurface

Payload entry had an empty surface form.

Fields

§entry_index: usize

Zero-based entry index.

§

DuplicateSurface

Surface form appeared more than once.

Fields

§surface: String

Duplicated surface form.

§

EmptyReadings

Payload entry had no readings.

Fields

§surface: String

Surface form for the invalid entry.

§

EmptyReading

Payload entry contained an empty reading.

Fields

§surface: String

Surface form for the invalid entry.

§reading_index: usize

Zero-based reading index.

§

DuplicateReading

Payload entry contained the same reading more than once.

Fields

§surface: String

Surface form for the invalid entry.

§reading: String

Duplicated reading.

Trait Implementations§

Source§

impl Debug for UnidicArtifactPayloadError

Source§

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

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

impl Display for UnidicArtifactPayloadError

Source§

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

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

impl Error for UnidicArtifactPayloadError

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 From<Error> for UnidicArtifactPayloadError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for UnidicArtifactPayloadError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.