Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error { Parse(ParseError), Rule { kind: &'static str, locale: String, category: String, source: ParseError, }, Table { line: usize, message: String, }, Pattern { pattern: String, message: &'static str, }, Missing { locale: String, system: String, field: &'static str, }, Entry(WriteError), Json(Error), Shape(String), Assumption(String), Io { path: PathBuf, source: Error, }, IcuData(DataError), IcuBlobBuild { locale: String, count: usize, first: String, }, }
Expand description

A problem with the shipped rule table or the CLDR input.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Parse(ParseError)

A plural rule does not parse.

§

Rule

A plural rule of the shipped table does not parse.

Fields

§kind: &'static str

cardinal or ordinal.

§locale: String

The locale.

§category: String

The plural category.

§source: ParseError

Why.

§

Table

A line of a shipped table is malformed.

Fields

§line: usize

One-based line.

§message: String

What is wrong.

§

Pattern

A CLDR number pattern the encoder does not accept.

Fields

§pattern: String

The pattern.

§message: &'static str

What is wrong.

§

Missing

A locale’s number data lacks a field.

Fields

§locale: String

The locale.

§system: String

The numbering system.

§field: &'static str

The missing field.

§

Entry(WriteError)

The catalog writer refused a LOCALE entry.

§

Json(Error)

Available on crate feature extract only.

The CLDR JSON does not parse (extract).

§

Shape(String)

Available on crate feature extract only.

The CLDR JSON is not shaped as expected (extract).

§

Assumption(String)

Available on crate feature extract only.

The CLDR input breaks an assumption the table format rests on (the extractor checks each one, so a CLDR update that changes them is noticed, not silently mis-encoded).

§

Io

Available on crate feature extract only.

A file could not be read or written (extract).

Fields

§path: PathBuf

The file.

§source: Error

What the operating system said.

§

IcuData(DataError)

Available on crate feature icu-blob only.

ICU4X data for icu.blob (icu-blob).

§

IcuBlobBuild

Available on crate feature icu-blob only.

Some formatter of the datetime-icu backend does not build from ICU4X’s data for the locale (icu-blob).

Fields

§locale: String

The locale.

§count: usize

How many formatters fail.

§first: String

The first that does.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

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<DataError> for Error

Source§

fn from(source: DataError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ParseError> for Error

Source§

fn from(source: ParseError) -> Self

Converts to this type from the input type.
Source§

impl From<WriteError> for Error

Source§

fn from(source: WriteError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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> ErasedDestructor for T
where T: 'static,

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.