[−][src]Enum langtag::LanguageTagBuf
Language tag with owned data.
Variants
Normal(LangTag<T>)
Normal language tag.
PrivateUse(PrivateUseTag<T>)
Private use tag.
Grandfathered(GrandfatheredTag)
Grandfathered tag.
Implementations
impl<T: AsRef<[u8]>> LanguageTagBuf<T>
[src]
pub fn new(t: T) -> Result<LanguageTagBuf<T>, Error>
[src]
Create a new language tag parsing and using the given data.
pub fn as_ref(&self) -> LanguageTag<'_, T>
[src]
Returns a LanguageTag
referencing this tag.
impl LanguageTagBuf
[src]
pub fn parse_copy<T: AsRef<[u8]> + ?Sized>(
t: &T
) -> Result<LanguageTagBuf, Error>
[src]
t: &T
) -> Result<LanguageTagBuf, Error>
reate a new language tag owning its data by parsing and copying the given data.
impl<T: AsRef<[u8]>> LanguageTagBuf<T>
[src]
pub fn as_bytes(&self) -> &[u8]
[src]
Returns the bytes representation of the language tag.
pub fn as_str(&self) -> &str
[src]
Returns the string representation of the language tag.
pub fn is_normal(&self) -> bool
[src]
Checks if this is a normal language tag.
pub fn is_private_use(&self) -> bool
[src]
Checks if this is a private use tag.
pub fn is_grandfathered(&self) -> bool
[src]
Checks if this is a grandfathered tag.
pub fn language(&self) -> Option<&Language>
[src]
Get the language subtags, if any.
Only normal language tags and regular grandfathered tags have language subtags.
pub fn script(&self) -> Option<&Script>
[src]
Get the script subtag, if any.
pub fn region(&self) -> Option<&Region>
[src]
Get the region subtag, if any.
pub fn variants(&self) -> &Variants
[src]
Get the variant subtags.
pub fn extensions(&self) -> &Extensions
[src]
Get the extension subtags.
pub fn private_use_subtags(&self) -> &PrivateUseSubtags
[src]
Get the private use subtags.
Trait Implementations
impl<T: AsRef<[u8]>> AsRef<[u8]> for LanguageTagBuf<T>
[src]
impl<T: AsRef<[u8]>> AsRef<str> for LanguageTagBuf<T>
[src]
impl<T: Clone> Clone for LanguageTagBuf<T>
[src]
pub fn clone(&self) -> LanguageTagBuf<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: AsRef<[u8]>> Debug for LanguageTagBuf<T>
[src]
impl<T: AsRef<[u8]>> Display for LanguageTagBuf<T>
[src]
impl<T: AsRef<[u8]>> Eq for LanguageTagBuf<T>
[src]
impl<T: AsRef<[u8]>> Hash for LanguageTagBuf<T>
[src]
pub fn hash<H: Hasher>(&self, h: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: AsRef<[u8]>> Ord for LanguageTagBuf<T>
[src]
pub fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: AsRef<[u8]>, U: AsRef<[u8]> + ?Sized> PartialEq<U> for LanguageTagBuf<T>
[src]
impl<T: AsRef<[u8]>, U: AsRef<[u8]>> PartialOrd<U> for LanguageTagBuf<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for LanguageTagBuf<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for LanguageTagBuf<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for LanguageTagBuf<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for LanguageTagBuf<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for LanguageTagBuf<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,