Skip to main content

LingoraError

Enum LingoraError 

Source
pub enum LingoraError {
    Io(Error),
    TomlParse(Error),
    Args(Error),
    Fluent(Fluent4rsError),
    Syn(Error),
    InvalidLocale(String),
    InvalidFluentPath(PathBuf),
    InvalidRustPath(PathBuf),
    AmbiguousLanguageRoots(String),
    MissingTranslationFiles(String),
    MissingPrimaryLocales(String),
    MalformedIdentifierLiteral(String),
}
Expand description

Error type for the lingora-core crate.

Variants§

§

Io(Error)

An I/O error occurred while reading/writing files (Fluent files, config, Rust sources, etc)

§

TomlParse(Error)

Failed to deserialize Lingora.toml configuration file.

§

Args(Error)

Clap failed to parse command-line arguments.

§

Fluent(Fluent4rsError)

Error originating from the fluent4rs parser while parsing .ftl files.

§

Syn(Error)

syn failed to parse Rust source code (used when scanning for t!, te!, tid! macros).

§

InvalidLocale(String)

The provided locale string is not a valid BCP 47 language tag. Example: "french" instead of "fr", or "en_US" (underscore instead of hyphen).

§

InvalidFluentPath(PathBuf)

A file path was given as a Fluent translation file, but it doesn’t match expected naming conventions or location rules (e.g. wrong extension, not under a locale dir).

§

InvalidRustPath(PathBuf)

A path was provided as a Rust source file to scan, but it cannot be processed (wrong extension, not readable, outside project root, etc)

§

AmbiguousLanguageRoots(String)

Multiple locale files resolve to the same primary language root, making it impossible to determine a clean fallback chain (e.g. two files both treated as “en”). This usually indicates misconfiguration in Lingora.toml or ambiguous file naming.

§

MissingTranslationFiles(String)

The configuration or CLI arguments require translation files for certain locales, but none were found on disk.

§

MissingPrimaryLocales(String)

The workspace or configuration specifies locales, but none of them qualify as primary locales (i.e. no non-variant/base-language documents were located).

§

MalformedIdentifierLiteral(String)

A string literal found in Rust code (inside a t!, te! or tid! macro) does not conform to the expected Fluent identifier syntax.

Examples of malformed literals:

  • contains invalid characters
  • starts with a digit
  • has invalid dot/hyphen placement

Trait Implementations§

Source§

impl Debug for LingoraError

Source§

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

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

impl Display for LingoraError

Source§

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

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

impl Error for LingoraError

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 LingoraError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for LingoraError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for LingoraError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for LingoraError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Fluent4rsError> for LingoraError

Source§

fn from(source: Fluent4rsError) -> 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<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

Source§

type Proj<U: 'src> = U

Source§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

Source§

impl<T, S> SpanWrap<S> for T
where S: WrappingSpan<T>,

Source§

fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned

Invokes WrappingSpan::make_wrapped to wrap an AST node in a span.
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.