pub enum LanguageError {
EmptySubtag,
SubtagTooLong(String),
InvalidCharacter(char),
BadPrimarySubtag(String),
BareSingleton(String),
RepeatedSubtag(String),
}Expand description
Why a string is not a valid language tag.
Variants§
EmptySubtag
Empty, or a leading, trailing or doubled hyphen.
SubtagTooLong(String)
A subtag over MAX_SUBTAG_LENGTH characters.
InvalidCharacter(char)
A character outside A-Za-z0-9-.
BadPrimarySubtag(String)
The primary subtag is not two or three lowercase letters, and the tag does not open with the private-use or grandfathered singleton.
BareSingleton(String)
x or i with nothing after it.
RepeatedSubtag(String)
A variant or extension singleton subtag appears twice.
Trait Implementations§
Source§impl Clone for LanguageError
impl Clone for LanguageError
Source§fn clone(&self) -> LanguageError
fn clone(&self) -> LanguageError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LanguageError
impl Debug for LanguageError
Source§impl Display for LanguageError
impl Display for LanguageError
Source§impl Error for LanguageError
impl Error for LanguageError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for LanguageError
impl PartialEq for LanguageError
Source§fn eq(&self, other: &LanguageError) -> bool
fn eq(&self, other: &LanguageError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for LanguageError
impl StructuralPartialEq for LanguageError
Auto Trait Implementations§
impl Freeze for LanguageError
impl RefUnwindSafe for LanguageError
impl Send for LanguageError
impl Sync for LanguageError
impl Unpin for LanguageError
impl UnsafeUnpin for LanguageError
impl UnwindSafe for LanguageError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.