Enum actix_web::http::header::Preference
source · pub enum Preference<T> {
Any,
Specific(T),
}
Expand description
A wrapper for types used in header values where wildcard (*
) items are allowed but the
underlying type does not support them.
For example, we use the language-tags
crate for the AcceptLanguage
typed header but it does not parse *
successfully. On the other hand, the mime
crate, used
for Accept
, has first-party support for wildcard items so this wrapper is not
used in those header types.
Variants§
Implementations§
source§impl<T> Preference<T>
impl<T> Preference<T>
sourcepub fn is_specific(&self) -> bool
pub fn is_specific(&self) -> bool
Returns true if preference is the specific item (T
) variant.
Trait Implementations§
source§impl<T: Clone> Clone for Preference<T>
impl<T: Clone> Clone for Preference<T>
source§fn clone(&self) -> Preference<T>
fn clone(&self) -> Preference<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for Preference<T>
impl<T: Debug> Debug for Preference<T>
source§impl<T: Display> Display for Preference<T>
impl<T: Display> Display for Preference<T>
source§impl<T: FromStr> FromStr for Preference<T>
impl<T: FromStr> FromStr for Preference<T>
source§impl<T: Hash> Hash for Preference<T>
impl<T: Hash> Hash for Preference<T>
source§impl<T: PartialEq> PartialEq for Preference<T>
impl<T: PartialEq> PartialEq for Preference<T>
source§fn eq(&self, other: &Preference<T>) -> bool
fn eq(&self, other: &Preference<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd> PartialOrd for Preference<T>
impl<T: PartialOrd> PartialOrd for Preference<T>
source§fn partial_cmp(&self, other: &Preference<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Preference<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Copy> Copy for Preference<T>
impl<T: Eq> Eq for Preference<T>
impl<T> StructuralPartialEq for Preference<T>
Auto Trait Implementations§
impl<T> Freeze for Preference<T>where
T: Freeze,
impl<T> RefUnwindSafe for Preference<T>where
T: RefUnwindSafe,
impl<T> Send for Preference<T>where
T: Send,
impl<T> Sync for Preference<T>where
T: Sync,
impl<T> Unpin for Preference<T>where
T: Unpin,
impl<T> UnwindSafe for Preference<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.