Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 16 variants Io { path: PathBuf, source: Error, }, Config { path: PathBuf, message: String, }, Json { path: PathBuf, line: u32, column: u32, message: String, }, Locale { locale: String, source: Error, }, Write { locale: String, source: WriteError, }, LocaleData(Error), Manifest(ManifestError), Catalog(WriteError), Compress { locale: String, format: &'static str, source: Error, }, Layout(String), LocaleVariant { first: String, second: String, variant: String, }, MarkupHash { first: String, second: String, }, Corpus { errors: usize, locales: usize, }, NoMf2, Mf2Version { mf2: String, build: String, }, IcuBlob,
}
Expand description

What stops a build.

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

Io

A file could not be read or written.

Fields

§path: PathBuf

The file.

§source: Error

What the operating system said.

§

Config

mf2.toml is not valid TOML, or a key in it is wrong.

Fields

§path: PathBuf

The configuration file.

§message: String

Which key, and what is wrong with it.

§

Json

A flat JSON corpus is not an object of strings.

Fields

§path: PathBuf

The file.

§line: u32

One-based line.

§column: u32

One-based column.

§message: String

What is wrong.

§

Locale

The locale directory names a tag the catalog format cannot write.

Fields

§locale: String

The tag.

§source: Error

What the locale data said.

§

Write

The catalog writer refused a locale’s messages.

Fields

§locale: String

The tag.

§source: WriteError

What the writer said.

§

LocaleData(Error)

The locale data could not be sliced.

§

Manifest(ManifestError)

The manifest could not be written or read back.

§

Catalog(WriteError)

A catalog could not be written.

§

Compress

A catalog could not be compressed.

Both encoders write into a Vec, so this is a compressor fault, not a full disk. It is still an error rather than a shrug: a truncated .br would be served immutable beside a .mf2b whose content hash says it is intact, and the client would see a corrupt catalog.

Fields

§locale: String

The tag.

§format: &'static str

brotli or gzip.

§source: Error

What the encoder said.

§

Layout(String)

The layout on disk is not what a build needs.

§

LocaleVariant

Two locales’ tags give the generated Locale one variant: pt-BR and pt_br are both Locale::PtBr.

Fields

§first: String

The first of the two tags.

§second: String

The second.

§variant: String

The variant they share.

§

MarkupHash

Two markup names have one hash, so a style could not tell them apart.

Fields

§first: String

The first of the two.

§second: String

The second.

§

Corpus

The build found errors in the corpus; they are in the report.

Fields

§errors: usize

How many errors.

§locales: usize

In how many locales.

§

NoMf2

run cannot see mf2’s features: cargo passes them only to a crate that names mf2 as a normal dependency.

§

Mf2Version

mf2 and mf2-build are not the same version.

Fields

§mf2: String

What mf2 says its version is.

§build: String

This crate’s.

§

IcuBlob

mf2 has datetime-icu, and this mf2-build was built without icu-blob, which writes ICU4X’s date data into the catalogs. A build-dependency’s features cannot come through links.

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

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ManifestError> for Error

Source§

fn from(source: ManifestError) -> 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> 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 = !

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.