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
Any
A wildcard value.
Specific(T)
A valid T.
Implementations
Returns true if preference is the specific item (T) variant.
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
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
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
