pub struct LangTagBuf(/* private fields */);Expand description
Owned langtag.
Implementations§
Source§impl LangTagBuf
impl LangTagBuf
Sourcepub fn new<T>(input: T) -> Result<LangTagBuf, InvalidLangTag<T>>where
T: Buffer,
pub fn new<T>(input: T) -> Result<LangTagBuf, InvalidLangTag<T>>where
T: Buffer,
Creates a new owned langtag by parsing the input value.
Sourcepub fn from_bytes(input: Vec<u8>) -> Result<LangTagBuf, InvalidLangTag<Vec<u8>>>
pub fn from_bytes(input: Vec<u8>) -> Result<LangTagBuf, InvalidLangTag<Vec<u8>>>
Creates a new owned langtag by parsing the input bytes.
Sourcepub fn from_string(input: String) -> Result<LangTagBuf, InvalidLangTag<String>>
pub fn from_string(input: String) -> Result<LangTagBuf, InvalidLangTag<String>>
Creates a new owned langtag by parsing the input string.
Sourcepub unsafe fn new_unchecked(input: impl Into<Vec<u8>>) -> LangTagBuf
pub unsafe fn new_unchecked(input: impl Into<Vec<u8>>) -> LangTagBuf
Creates a new owned langtag from the input value without validation.
§Safety
The input value must be a valid langtag.
pub const fn as_lang_tag(&self) -> &LangTag
Methods from Deref<Target = LangTag>§
Sourcepub fn language(&self) -> Option<&Language>
pub fn language(&self) -> Option<&Language>
Returns 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
Returns the extension subtags, if any.
Sourcepub fn private_use(&self) -> Option<&PrivateUse>
pub fn private_use(&self) -> Option<&PrivateUse>
Returns the private use subtag, if any.
Returns an iterator over the private use subtag subtags.
Sourcepub fn is_normal(&self) -> bool
pub fn is_normal(&self) -> bool
Returns wether or not this language tag is a normal language tag.
Sourcepub fn is_private_use(&self) -> bool
pub fn is_private_use(&self) -> bool
Returns wether or not this language tag is a private use tag.
Sourcepub fn is_grandfathered(&self) -> bool
pub fn is_grandfathered(&self) -> bool
Returns wether or not this language tag is a grandfathered tag.
Sourcepub fn as_normal(&self) -> Option<&NormalLangTag>
pub fn as_normal(&self) -> Option<&NormalLangTag>
Returns this language tag as a normal tag, if it is one.
Sourcepub fn as_private_use(&self) -> Option<&PrivateUse>
pub fn as_private_use(&self) -> Option<&PrivateUse>
Returns this language tag as a private use tag, if it is one.
Sourcepub fn as_grandfathered(&self) -> Option<GrandfatheredLangTag>
pub fn as_grandfathered(&self) -> Option<GrandfatheredLangTag>
Returns this language tag as a grandfathered tag, if it is one.
Sourcepub fn as_typed(&self) -> TypedLangTag<'_>
pub fn as_typed(&self) -> TypedLangTag<'_>
Find out what kind of language tag self is.
Trait Implementations§
Source§impl AsRef<LangTag> for LangTagBuf
impl AsRef<LangTag> for LangTagBuf
Source§impl AsRef<[u8]> for LangTagBuf
impl AsRef<[u8]> for LangTagBuf
Source§impl AsRef<str> for LangTagBuf
impl AsRef<str> for LangTagBuf
Source§impl Borrow<LangTag> for LangTagBuf
impl Borrow<LangTag> for LangTagBuf
Source§impl Clone for LangTagBuf
impl Clone for LangTagBuf
Source§fn clone(&self) -> LangTagBuf
fn clone(&self) -> LangTagBuf
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LangTagBuf
impl Debug for LangTagBuf
Source§impl Deref for LangTagBuf
impl Deref for LangTagBuf
Source§impl Display for LangTagBuf
impl Display for LangTagBuf
impl Eq for LangTagBuf
Source§impl From<LangTagBuf> for LenientLangTagBuf
impl From<LangTagBuf> for LenientLangTagBuf
Source§fn from(tag: LangTagBuf) -> Self
fn from(tag: LangTagBuf) -> Self
Source§impl FromStr for LangTagBuf
impl FromStr for LangTagBuf
Source§type Err = InvalidLangTag<String>
type Err = InvalidLangTag<String>
Source§fn from_str(value: &str) -> Result<LangTagBuf, InvalidLangTag<String>>
fn from_str(value: &str) -> Result<LangTagBuf, InvalidLangTag<String>>
s to return a value of this type. Read moreSource§impl Hash for LangTagBuf
impl Hash for LangTagBuf
Source§impl Ord for LangTagBuf
impl Ord for LangTagBuf
Source§fn cmp(&self, other: &LangTagBuf) -> Ordering
fn cmp(&self, other: &LangTagBuf) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for LangTagBuf
impl PartialEq for LangTagBuf
Source§impl PartialEq<&LangTag> for LangTagBuf
impl PartialEq<&LangTag> for LangTagBuf
Source§impl PartialEq<&[u8]> for LangTagBuf
impl PartialEq<&[u8]> for LangTagBuf
Source§impl PartialEq<&str> for LangTagBuf
impl PartialEq<&str> for LangTagBuf
Source§impl PartialEq<LangTag> for LangTagBuf
impl PartialEq<LangTag> for LangTagBuf
Source§impl PartialEq<LangTagBuf> for LangTag
impl PartialEq<LangTagBuf> for LangTag
Source§impl PartialEq<LangTagBuf> for &LangTag
impl PartialEq<LangTagBuf> for &LangTag
Source§impl PartialEq<String> for LangTagBuf
impl PartialEq<String> for LangTagBuf
Source§impl PartialEq<[u8]> for LangTagBuf
impl PartialEq<[u8]> for LangTagBuf
Source§impl PartialEq<str> for LangTagBuf
impl PartialEq<str> for LangTagBuf
Source§impl PartialOrd for LangTagBuf
impl PartialOrd for LangTagBuf
Source§impl PartialOrd<&LangTag> for LangTagBuf
impl PartialOrd<&LangTag> for LangTagBuf
Source§impl PartialOrd<&[u8]> for LangTagBuf
impl PartialOrd<&[u8]> for LangTagBuf
Source§impl PartialOrd<&str> for LangTagBuf
impl PartialOrd<&str> for LangTagBuf
Source§impl PartialOrd<LangTag> for LangTagBuf
impl PartialOrd<LangTag> for LangTagBuf
Source§impl PartialOrd<LangTagBuf> for LangTag
impl PartialOrd<LangTagBuf> for LangTag
Source§impl PartialOrd<LangTagBuf> for &LangTag
impl PartialOrd<LangTagBuf> for &LangTag
Source§impl PartialOrd<String> for LangTagBuf
impl PartialOrd<String> for LangTagBuf
Source§impl PartialOrd<Vec<u8>> for LangTagBuf
impl PartialOrd<Vec<u8>> for LangTagBuf
Source§impl PartialOrd<[u8]> for LangTagBuf
impl PartialOrd<[u8]> for LangTagBuf
Source§impl PartialOrd<str> for LangTagBuf
impl PartialOrd<str> for LangTagBuf
Source§impl RdfDisplay for LangTagBuf
impl RdfDisplay for LangTagBuf
Source§impl TryFrom<String> for LangTagBuf
impl TryFrom<String> for LangTagBuf
Source§type Error = InvalidLangTag<String>
type Error = InvalidLangTag<String>
Source§fn try_from(value: String) -> Result<LangTagBuf, InvalidLangTag<String>>
fn try_from(value: String) -> Result<LangTagBuf, InvalidLangTag<String>>
Auto Trait Implementations§
impl Freeze for LangTagBuf
impl RefUnwindSafe for LangTagBuf
impl Send for LangTagBuf
impl Sync for LangTagBuf
impl Unpin for LangTagBuf
impl UnsafeUnpin for LangTagBuf
impl UnwindSafe for LangTagBuf
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
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Unordered reference.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
self is equivalent to key.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more