pub struct Language(pub FosterByteStringVector);
Expand description
Language tag value in HTTP headers.
See IETF RFC 5646 section 2.1.
Stored as a sequence of subtags.
Note that even though ISO recommends cased representations, they are case-insensitive in HTTP. Thus we convert all subtags to lowercase for comparison efficiency.
Tuple Fields§
§0: FosterByteStringVector
Implementations§
Source§impl Language
impl Language
Sourcepub fn new_owned(strings: Vec<ByteString>) -> Self
pub fn new_owned(strings: Vec<ByteString>) -> Self
Constructor.
Sourcepub const fn new_fostered(strings: &'static [&'static str]) -> Self
pub const fn new_fostered(strings: &'static [&'static str]) -> Self
Constructor.
Source§impl Language
impl Language
Sourcepub fn parse_list(representation: &str) -> Option<FastHashSet<Self>>
pub fn parse_list(representation: &str) -> Option<FastHashSet<Self>>
Parse list.
Trait Implementations§
Source§impl CacheWeight for Language
impl CacheWeight for Language
Source§fn cache_weight(&self) -> usize
fn cache_weight(&self) -> usize
Cache weight as a byte count. Read more
Source§impl From<Vec<ByteString>> for Language
impl From<Vec<ByteString>> for Language
Source§fn from(strings: Vec<ByteString>) -> Self
fn from(strings: Vec<ByteString>) -> Self
Converts to this type from the input type.
Source§impl Into<HeaderValue> for Language
impl Into<HeaderValue> for Language
Source§fn into(self) -> HeaderValue
fn into(self) -> HeaderValue
Converts this type into the (usually inferred) input type.
Source§impl<'own> IntoIterator for &'own Language
impl<'own> IntoIterator for &'own Language
Source§type IntoIter = Foster<ConvertingIterator<&'own str, Iter<'own, ByteString>, &'own ByteString>, ConvertingIterator<&'own str, Iter<'own, &'static str>, &'own &'static str>>
type IntoIter = Foster<ConvertingIterator<&'own str, Iter<'own, ByteString>, &'own ByteString>, ConvertingIterator<&'own str, Iter<'own, &'static str>, &'own &'static str>>
Which kind of iterator are we turning this into?
Source§impl Ord for Language
impl Ord for Language
Source§impl PartialOrd for Language
impl PartialOrd for Language
impl Eq for Language
Auto Trait Implementations§
impl Freeze for Language
impl RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl UnwindSafe for Language
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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
Compare self to
key
and return true
if they are equal.