#[non_exhaustive]pub enum TagError {
Empty,
TooLong,
Character(char),
EmptySubtag,
NoLanguage,
Language(String),
Grandfathered,
Extlang(String),
Extension(char),
RepeatedVariant(String),
PrivateUse,
Misplaced(String),
}Expand description
Why a text isn’t a language tag (LangCode::parse).
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.
Empty
There is no text.
TooLong
The text is longer than 35 characters.
Character(char)
The text holds a character a tag can’t: anything but letters, digits
and -.
EmptySubtag
Two - side by side, or one at an end.
NoLanguage
A POSIX locale with no language: C or POSIX.
Language(String)
The first subtag isn’t a language of 2 to 8 letters.
Grandfathered
A grandfathered tag (i-klingon), which the subset leaves out.
Extlang(String)
3 letters right after the language (zh-yue): an extended language
subtag, which the subset leaves out.
Extension(char)
An extension (-u-ca-gregory, -t-), which the subset leaves out.
RepeatedVariant(String)
A variant written twice.
PrivateUse
x with nothing after it, or a private-use subtag longer than 8.
Misplaced(String)
A subtag where it can’t be: a script after the region, say.
Trait Implementations§
impl Eq for TagError
impl StructuralPartialEq for TagError
Auto Trait Implementations§
impl Freeze for TagError
impl RefUnwindSafe for TagError
impl Send for TagError
impl Sync for TagError
impl Unpin for TagError
impl UnsafeUnpin for TagError
impl UnwindSafe for TagError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more