[−][src]Struct langtag::Extensions
List of extensions.
A list of language tag extension, separated by a -
character.
Individual extensions are represented by the Extension
type,
while extension subtags are represented by the ExtensionSubtag
type.
Implementations
impl<T: AsRef<[u8]>> Extensions<T>
[src]
pub fn new(t: T) -> Result<Extensions<T>, Error>
[src]
Parse and use the given data.
pub unsafe fn new_unchecked(t: T) -> Extensions<T>
[src]
Use the given data as buffer without parsing it.
Safety
The given data must be syntactically correct.
impl Extensions<[u8]>
[src]
pub fn parse<'a, T: AsRef<[u8]> + ?Sized>(
bytes: &'a T
) -> Result<&'a Extensions<[u8]>, Error>
[src]
bytes: &'a T
) -> Result<&'a Extensions<[u8]>, Error>
Parse and borrow the given data.
pub unsafe fn parse_unchecked<'a, T: AsRef<[u8]> + ?Sized>(
bytes: &'a T
) -> &'a Extensions<[u8]>
[src]
bytes: &'a T
) -> &'a Extensions<[u8]>
Borrow the given data without checking that it is syntactically correct.
Safety
The data must be syntactically correct.
impl Extensions<Vec<u8>>
[src]
pub fn parse_copy<'a, T: AsRef<[u8]> + ?Sized>(
bytes: &'a T
) -> Result<Extensions<Vec<u8>>, Error>
[src]
bytes: &'a T
) -> Result<Extensions<Vec<u8>>, Error>
Parse and copy the input data.
pub unsafe fn parse_copy_unchecked<'a, T: AsRef<[u8]> + ?Sized>(
bytes: &'a T
) -> Extensions<Vec<u8>>
[src]
bytes: &'a T
) -> Extensions<Vec<u8>>
Copy the input data without checking its syntax correctness.
Safety
The input data must be syntactically correct.
impl<T: AsRef<[u8]> + ?Sized> Extensions<T>
[src]
pub fn len(&self) -> usize
[src]
Bytes length.
pub fn as_bytes(&self) -> &[u8]
[src]
Return a reference to the underlying data.
pub fn as_str(&self) -> &str
[src]
Return a reference to the underlying data as a string.
impl Extensions
[src]
pub fn empty() -> &'static Extensions
[src]
The empty list of extension (an empty string).
pub fn iter(&self) -> ExtensionsIter<'_>ⓘNotable traits for ExtensionsIter<'a>
impl<'a> Iterator for ExtensionsIter<'a> type Item = &'a Extension;
[src]
Notable traits for ExtensionsIter<'a>
impl<'a> Iterator for ExtensionsIter<'a> type Item = &'a Extension;
Iterate extensions.
pub fn iter_subtags(&self) -> ExtensionsSubtagsIter<'_>ⓘNotable traits for ExtensionsSubtagsIter<'a>
impl<'a> Iterator for ExtensionsSubtagsIter<'a> type Item = (Singleton, &'a ExtensionSubtag);
[src]
Notable traits for ExtensionsSubtagsIter<'a>
impl<'a> Iterator for ExtensionsSubtagsIter<'a> type Item = (Singleton, &'a ExtensionSubtag);
Iterate through each extensions subtags.
Eah subtag will be attached to its extension's singleton.
pub fn iter_extension(&self, e: Singleton) -> ExtensionSubtagsIter<'_>ⓘNotable traits for ExtensionSubtagsIter<'a>
impl<'a> Iterator for ExtensionSubtagsIter<'a> type Item = &'a ExtensionSubtag;
[src]
Notable traits for ExtensionSubtagsIter<'a>
impl<'a> Iterator for ExtensionSubtagsIter<'a> type Item = &'a ExtensionSubtag;
Iterate through a specific extension subtags.
Trait Implementations
impl<T: AsRef<[u8]> + ?Sized> AsRef<[u8]> for Extensions<T>
[src]
impl<T: AsRef<[u8]> + ?Sized> AsRef<str> for Extensions<T>
[src]
impl<T: AsRef<[u8]> + ?Sized> Debug for Extensions<T>
[src]
impl<T: ?Sized> Deref for Extensions<T>
[src]
impl<T: AsRef<[u8]> + ?Sized> Display for Extensions<T>
[src]
impl<T: AsRef<[u8]> + ?Sized> Eq for Extensions<T>
[src]
impl<T: AsRef<[u8]> + ?Sized> Hash for Extensions<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<'a> IntoIterator for &'a Extensions
[src]
type IntoIter = ExtensionsIter<'a>
Which kind of iterator are we turning this into?
type Item = &'a Extension
The type of the elements being iterated over.
pub fn into_iter(self) -> ExtensionsIter<'a>ⓘNotable traits for ExtensionsIter<'a>
impl<'a> Iterator for ExtensionsIter<'a> type Item = &'a Extension;
[src]
Notable traits for ExtensionsIter<'a>
impl<'a> Iterator for ExtensionsIter<'a> type Item = &'a Extension;
impl<T: AsRef<[u8]> + ?Sized> Ord for Extensions<T>
[src]
pub fn cmp(&self, other: &Extensions<T>) -> 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]> + ?Sized> PartialEq<[u8]> for Extensions<T>
[src]
pub fn eq(&self, other: &[u8]) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: AsRef<[u8]> + ?Sized> PartialEq<Extensions<T>> for [u8]
[src]
pub fn eq(&self, other: &Extensions<T>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: AsRef<[u8]> + ?Sized> PartialEq<Extensions<T>> for str
[src]
pub fn eq(&self, other: &Extensions<T>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: AsRef<[u8]> + ?Sized, U: AsRef<[u8]> + ?Sized> PartialEq<Extensions<U>> for Extensions<T>
[src]
pub fn eq(&self, other: &Extensions<U>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: AsRef<[u8]> + ?Sized> PartialEq<str> for Extensions<T>
[src]
pub fn eq(&self, other: &str) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: AsRef<[u8]> + ?Sized, U: AsRef<[u8]> + ?Sized> PartialOrd<Extensions<U>> for Extensions<T>
[src]
pub fn partial_cmp(&self, other: &Extensions<U>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> TryFrom<&'a [u8]> for &'a Extensions<[u8]>
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(b: &'a [u8]) -> Result<&'a Extensions<[u8]>, Error>
[src]
impl<'a> TryFrom<&'a str> for &'a Extensions<[u8]>
[src]
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for Extensions<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T: ?Sized> Send for Extensions<T> where
T: Send,
[src]
T: Send,
impl<T: ?Sized> Sync for Extensions<T> where
T: Sync,
[src]
T: Sync,
impl<T: ?Sized> Unpin for Extensions<T> where
T: Unpin,
[src]
T: Unpin,
impl<T: ?Sized> UnwindSafe for Extensions<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> 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>,