pub struct NormalLangTag(/* private fields */);Expand description
Normal language tag.
Implementations§
Source§impl NormalLangTag
impl NormalLangTag
pub const fn validate_str(input: &str) -> bool
pub const fn validate_bytes(input: &[u8]) -> bool
Source§impl NormalLangTag
impl NormalLangTag
Sourcepub fn new<T: ?Sized + AsRef<[u8]>>(
input: &T,
) -> Result<&Self, InvalidNormalLangTag<&T>>
pub fn new<T: ?Sized + AsRef<[u8]>>( input: &T, ) -> Result<&Self, InvalidNormalLangTag<&T>>
Creates a new normallangtag by parsing the input value.
Sourcepub const fn from_bytes(
input: &[u8],
) -> Result<&Self, InvalidNormalLangTag<&[u8]>>
pub const fn from_bytes( input: &[u8], ) -> Result<&Self, InvalidNormalLangTag<&[u8]>>
Creates a new normallangtag by parsing the input bytes.
Sourcepub const fn from_str(input: &str) -> Result<&Self, InvalidNormalLangTag<&str>>
pub const fn from_str(input: &str) -> Result<&Self, InvalidNormalLangTag<&str>>
Creates a new normallangtag by parsing the input string.
Sourcepub const unsafe fn new_unchecked_from_bytes(input: &[u8]) -> &Self
pub const unsafe fn new_unchecked_from_bytes(input: &[u8]) -> &Self
Creates a new normallangtag from the input bytes without validation.
§Safety
The input bytes must be a valid normallangtag.
Sourcepub const unsafe fn new_unchecked(input: &str) -> &Self
pub const unsafe fn new_unchecked(input: &str) -> &Self
Creates a new normallangtag from the input string without validation.
§Safety
The input string must be a valid normallangtag.
Source§impl NormalLangTag
impl NormalLangTag
Source§impl NormalLangTag
impl NormalLangTag
Sourcepub fn extensions(&self) -> &Extensions
pub fn extensions(&self) -> &Extensions
Returns the extension subtags.
Sourcepub fn private_use(&self) -> Option<&PrivateUse>
pub fn private_use(&self) -> Option<&PrivateUse>
Returns the private use subtags.
Trait Implementations§
Source§impl AsRef<NormalLangTag> for NormalLangTag
impl AsRef<NormalLangTag> for NormalLangTag
Source§fn as_ref(&self) -> &NormalLangTag
fn as_ref(&self) -> &NormalLangTag
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<NormalLangTag> for NormalLangTagBuf
impl AsRef<NormalLangTag> for NormalLangTagBuf
Source§fn as_ref(&self) -> &NormalLangTag
fn as_ref(&self) -> &NormalLangTag
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<[u8]> for NormalLangTag
impl AsRef<[u8]> for NormalLangTag
Source§impl AsRef<str> for NormalLangTag
impl AsRef<str> for NormalLangTag
Source§impl Borrow<NormalLangTag> for NormalLangTagBuf
impl Borrow<NormalLangTag> for NormalLangTagBuf
Source§fn borrow(&self) -> &NormalLangTag
fn borrow(&self) -> &NormalLangTag
Immutably borrows from an owned value. Read more
Source§impl Borrow<str> for NormalLangTag
impl Borrow<str> for NormalLangTag
Source§impl Debug for NormalLangTag
impl Debug for NormalLangTag
Source§impl<'a, 'de> Deserialize<'de> for &'a NormalLangTagwhere
'de: 'a,
impl<'a, 'de> Deserialize<'de> for &'a NormalLangTagwhere
'de: 'a,
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for NormalLangTag
impl Display for NormalLangTag
impl Eq for NormalLangTag
Source§impl<'a> From<&'a NormalLangTag> for &'a str
impl<'a> From<&'a NormalLangTag> for &'a str
Source§fn from(value: &'a NormalLangTag) -> Self
fn from(value: &'a NormalLangTag) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a NormalLangTag> for &'a [u8]
impl<'a> From<&'a NormalLangTag> for &'a [u8]
Source§fn from(value: &'a NormalLangTag) -> Self
fn from(value: &'a NormalLangTag) -> Self
Converts to this type from the input type.
Source§impl Hash for NormalLangTag
impl Hash for NormalLangTag
Source§impl Ord for NormalLangTag
impl Ord for NormalLangTag
Source§impl PartialEq for NormalLangTag
impl PartialEq for NormalLangTag
Source§impl PartialEq<&NormalLangTag> for NormalLangTagBuf
impl PartialEq<&NormalLangTag> for NormalLangTagBuf
Source§fn eq(&self, other: &&NormalLangTag) -> bool
fn eq(&self, other: &&NormalLangTag) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<&[u8]> for NormalLangTag
impl PartialEq<&[u8]> for NormalLangTag
Source§impl PartialEq<&str> for NormalLangTag
impl PartialEq<&str> for NormalLangTag
Source§impl PartialEq<NormalLangTag> for [u8]
impl PartialEq<NormalLangTag> for [u8]
Source§fn eq(&self, other: &NormalLangTag) -> bool
fn eq(&self, other: &NormalLangTag) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<NormalLangTag> for &[u8]
impl PartialEq<NormalLangTag> for &[u8]
Source§fn eq(&self, other: &NormalLangTag) -> bool
fn eq(&self, other: &NormalLangTag) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<NormalLangTag> for str
impl PartialEq<NormalLangTag> for str
Source§fn eq(&self, other: &NormalLangTag) -> bool
fn eq(&self, other: &NormalLangTag) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<NormalLangTag> for &str
impl PartialEq<NormalLangTag> for &str
Source§fn eq(&self, other: &NormalLangTag) -> bool
fn eq(&self, other: &NormalLangTag) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<NormalLangTag> for Vec<u8>
impl PartialEq<NormalLangTag> for Vec<u8>
Source§fn eq(&self, other: &NormalLangTag) -> bool
fn eq(&self, other: &NormalLangTag) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<NormalLangTag> for String
impl PartialEq<NormalLangTag> for String
Source§fn eq(&self, other: &NormalLangTag) -> bool
fn eq(&self, other: &NormalLangTag) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<NormalLangTag> for NormalLangTagBuf
impl PartialEq<NormalLangTag> for NormalLangTagBuf
Source§fn eq(&self, other: &NormalLangTag) -> bool
fn eq(&self, other: &NormalLangTag) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<NormalLangTagBuf> for NormalLangTag
impl PartialEq<NormalLangTagBuf> for NormalLangTag
Source§fn eq(&self, other: &NormalLangTagBuf) -> bool
fn eq(&self, other: &NormalLangTagBuf) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<NormalLangTagBuf> for &NormalLangTag
impl PartialEq<NormalLangTagBuf> for &NormalLangTag
Source§fn eq(&self, other: &NormalLangTagBuf) -> bool
fn eq(&self, other: &NormalLangTagBuf) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialEq<String> for NormalLangTag
impl PartialEq<String> for NormalLangTag
Source§impl PartialEq<[u8]> for NormalLangTag
impl PartialEq<[u8]> for NormalLangTag
Source§impl PartialEq<str> for NormalLangTag
impl PartialEq<str> for NormalLangTag
Source§impl PartialOrd for NormalLangTag
impl PartialOrd for NormalLangTag
Source§impl PartialOrd<&NormalLangTag> for NormalLangTagBuf
impl PartialOrd<&NormalLangTag> for NormalLangTagBuf
Source§impl PartialOrd<&[u8]> for NormalLangTag
impl PartialOrd<&[u8]> for NormalLangTag
Source§impl PartialOrd<&str> for NormalLangTag
impl PartialOrd<&str> for NormalLangTag
Source§impl PartialOrd<NormalLangTag> for [u8]
impl PartialOrd<NormalLangTag> for [u8]
Source§impl PartialOrd<NormalLangTag> for &[u8]
impl PartialOrd<NormalLangTag> for &[u8]
Source§impl PartialOrd<NormalLangTag> for str
impl PartialOrd<NormalLangTag> for str
Source§impl PartialOrd<NormalLangTag> for &str
impl PartialOrd<NormalLangTag> for &str
Source§impl PartialOrd<NormalLangTag> for Vec<u8>
impl PartialOrd<NormalLangTag> for Vec<u8>
Source§impl PartialOrd<NormalLangTag> for String
impl PartialOrd<NormalLangTag> for String
Source§impl PartialOrd<NormalLangTag> for NormalLangTagBuf
impl PartialOrd<NormalLangTag> for NormalLangTagBuf
Source§impl PartialOrd<NormalLangTagBuf> for NormalLangTag
impl PartialOrd<NormalLangTagBuf> for NormalLangTag
Source§impl PartialOrd<NormalLangTagBuf> for &NormalLangTag
impl PartialOrd<NormalLangTagBuf> for &NormalLangTag
Source§impl PartialOrd<String> for NormalLangTag
impl PartialOrd<String> for NormalLangTag
Source§impl PartialOrd<Vec<u8>> for NormalLangTag
impl PartialOrd<Vec<u8>> for NormalLangTag
Source§impl PartialOrd<[u8]> for NormalLangTag
impl PartialOrd<[u8]> for NormalLangTag
Source§impl PartialOrd<str> for NormalLangTag
impl PartialOrd<str> for NormalLangTag
Source§impl Serialize for NormalLangTag
impl Serialize for NormalLangTag
Source§impl ToOwned for NormalLangTag
impl ToOwned for NormalLangTag
Source§type Owned = NormalLangTagBuf
type Owned = NormalLangTagBuf
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
Source§impl<'a> TryFrom<&'a [u8]> for &'a NormalLangTag
impl<'a> TryFrom<&'a [u8]> for &'a NormalLangTag
Source§type Error = InvalidNormalLangTag<&'a [u8]>
type Error = InvalidNormalLangTag<&'a [u8]>
The type returned in the event of a conversion error.
Source§fn try_from(
value: &'a [u8],
) -> Result<&'a NormalLangTag, InvalidNormalLangTag<&'a [u8]>>
fn try_from( value: &'a [u8], ) -> Result<&'a NormalLangTag, InvalidNormalLangTag<&'a [u8]>>
Performs the conversion.
Source§impl<'a> TryFrom<&'a str> for &'a NormalLangTag
impl<'a> TryFrom<&'a str> for &'a NormalLangTag
Source§type Error = InvalidNormalLangTag<&'a str>
type Error = InvalidNormalLangTag<&'a str>
The type returned in the event of a conversion error.
Source§fn try_from(
value: &'a str,
) -> Result<&'a NormalLangTag, InvalidNormalLangTag<&'a str>>
fn try_from( value: &'a str, ) -> Result<&'a NormalLangTag, InvalidNormalLangTag<&'a str>>
Performs the conversion.