#[non_exhaustive]pub enum Error {
Show 13 variants
NonMongolianChar {
ch: char,
index: usize,
},
NormalizationFallback {
text: String,
written_units: Vec<WrittenUnit>,
},
NormalizeUnsupported {
locale: Locale,
},
UnknownWrittenUnit {
index: usize,
unit: String,
},
UnsupportedWrittenUnit {
index: usize,
unit: WrittenUnit,
},
NoCanonicalEncoding,
ExplicitZwj,
ControlRequiresControlPosition {
index: usize,
unit: WrittenUnit,
},
UnsupportedPositionedUnit {
index: usize,
unit: WrittenUnit,
position: UnitPosition,
},
ChainPositionMismatch,
TooManyRecords {
max: usize,
},
InvalidUnitSpec(String),
UnknownName {
kind: &'static str,
name: String,
},
}Expand description
Everything that can go wrong in this crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NonMongolianChar
shape() / normalize() input contains a character that is not a Mongolian letter,
FVS, MVS, NNBSP, nirugu or ZWJ. index is a char index (not a byte offset).
NormalizationFallback
Strict normalization found no canonical encoding for the written-unit shape
(Python NormalizationFallbackError).
Fields
written_units: Vec<WrittenUnit>Its shape, which the normalize table could not encode.
NormalizeUnsupported
The locale ships no normalize table (only MNG has one).
UnknownWrittenUnit
parse_written_units: a name that is neither a unit known to the normalize table nor
Mvs/Nirugu/Zwj.
UnsupportedWrittenUnit
normalize_written_units: a written unit this shaper’s normalize table does not know.
NoCanonicalEncoding
normalize_written_units: the sequence has no canonical MNG encoding (or the candidate
does not reshape to exactly the requested sequence).
ExplicitZwj
normalize_positioned_written_units: explicit Zwj records are rejected.
ControlRequiresControlPosition
normalize_positioned_written_units: Mvs / Nirugu need UnitPosition::Control.
UnsupportedPositionedUnit
normalize_positioned_written_units: (unit, position) is not in the HUD inventory
(a letter with Control lands here too).
ChainPositionMismatch
normalize_positioned_written_units: the records do not form a valid init…fina chain in
the supplied joining context.
TooManyRecords
normalize_positioned_written_units: more than the maximum number of records.
InvalidUnitSpec(String)
parse_written_units: empty unit, whitespace, or an ambiguous compact segmentation.
UnknownName
A contract name (Locale, Position, WrittenUnit, …) failed to parse.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()