pub enum LanguageTag<'a, T = [u8]>where
T: ?Sized,{
Normal(LangTag<&'a T>),
PrivateUse(&'a PrivateUseTag<T>),
Grandfathered(GrandfatheredTag),
}
Expand description
Language tag with borrowed data.
Variants§
Normal(LangTag<&'a T>)
Normal language tag.
PrivateUse(&'a PrivateUseTag<T>)
Private use tag.
Grandfathered(GrandfatheredTag)
Grandfathered tag.
Implementations§
Source§impl<'a, T> LanguageTag<'a, T>
impl<'a, T> LanguageTag<'a, T>
Sourcepub fn is_private_use(&self) -> bool
pub fn is_private_use(&self) -> bool
Checks if this is a private use tag.
Sourcepub fn is_grandfathered(&self) -> bool
pub fn is_grandfathered(&self) -> bool
Checks if this is a grandfathered tag.
Sourcepub fn language(&self) -> Option<&Language>
pub fn language(&self) -> Option<&Language>
Get the language subtags, if any.
Only normal language tags and regular grandfathered tags have language subtags.
Sourcepub fn extensions(&self) -> &Extensions
pub fn extensions(&self) -> &Extensions
Get the extension subtags.
Get the private use subtags.
Source§impl<'a> LanguageTag<'a>
impl<'a> LanguageTag<'a>
Trait Implementations§
Source§impl<'a, T> AsRef<[u8]> for LanguageTag<'a, T>
impl<'a, T> AsRef<[u8]> for LanguageTag<'a, T>
Source§impl<'a, T> AsRef<str> for LanguageTag<'a, T>
impl<'a, T> AsRef<str> for LanguageTag<'a, T>
Source§impl<'a, T> Clone for LanguageTag<'a, T>where
T: ?Sized,
impl<'a, T> Clone for LanguageTag<'a, T>where
T: ?Sized,
Source§fn clone(&self) -> LanguageTag<'a, T>
fn clone(&self) -> LanguageTag<'a, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a, T> Debug for LanguageTag<'a, T>
impl<'a, T> Debug for LanguageTag<'a, T>
Source§impl<'a, T> Display for LanguageTag<'a, T>
impl<'a, T> Display for LanguageTag<'a, T>
Source§impl<'a, T> Hash for LanguageTag<'a, T>
impl<'a, T> Hash for LanguageTag<'a, T>
Source§impl<'a, T> Ord for LanguageTag<'a, T>
impl<'a, T> Ord for LanguageTag<'a, T>
Source§fn cmp(&self, other: &LanguageTag<'a, T>) -> Ordering
fn cmp(&self, other: &LanguageTag<'a, T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a, T, U> PartialEq<U> for LanguageTag<'a, T>
impl<'a, T, U> PartialEq<U> for LanguageTag<'a, T>
Source§impl<'a, T, U> PartialOrd<U> for LanguageTag<'a, T>
impl<'a, T, U> PartialOrd<U> for LanguageTag<'a, T>
impl<'a, T> Copy for LanguageTag<'a, T>where
T: ?Sized,
impl<'a, T> Eq for LanguageTag<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for LanguageTag<'a, T>where
T: ?Sized,
impl<'a, T> RefUnwindSafe for LanguageTag<'a, T>where
T: RefUnwindSafe + ?Sized,
impl<'a, T> Send for LanguageTag<'a, T>
impl<'a, T> Sync for LanguageTag<'a, T>
impl<'a, T> Unpin for LanguageTag<'a, T>where
T: ?Sized,
impl<'a, T> UnwindSafe for LanguageTag<'a, T>where
T: RefUnwindSafe + ?Sized,
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