Struct mco_http::header::QualityItem
source · pub struct QualityItem<T> {
pub item: T,
pub quality: Quality,
}Expand description
Represents an item with a quality value as defined in RFC7231.
Fields§
§item: TThe actual contents of the field.
quality: QualityThe quality (client or server preference) for the value.
Implementations§
source§impl<T> QualityItem<T>
impl<T> QualityItem<T>
sourcepub fn new(item: T, quality: Quality) -> QualityItem<T>
pub fn new(item: T, quality: Quality) -> QualityItem<T>
Creates a new QualityItem from an item and a quality.
The item can be of any type.
The quality should be a value in the range [0, 1].
Trait Implementations§
source§impl<T: Clone> Clone for QualityItem<T>
impl<T: Clone> Clone for QualityItem<T>
source§fn clone(&self) -> QualityItem<T>
fn clone(&self) -> QualityItem<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 QualityItem<T>
impl<T: Debug> Debug for QualityItem<T>
source§impl<T: Display> Display for QualityItem<T>
impl<T: Display> Display for QualityItem<T>
source§impl<T: FromStr> FromStr for QualityItem<T>
impl<T: FromStr> FromStr for QualityItem<T>
source§impl<T: PartialEq> PartialEq for QualityItem<T>
impl<T: PartialEq> PartialEq for QualityItem<T>
source§fn eq(&self, other: &QualityItem<T>) -> bool
fn eq(&self, other: &QualityItem<T>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<T: PartialEq> PartialOrd for QualityItem<T>
impl<T: PartialEq> PartialOrd for QualityItem<T>
source§fn partial_cmp(&self, other: &QualityItem<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &QualityItem<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> StructuralPartialEq for QualityItem<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for QualityItem<T>where
T: RefUnwindSafe,
impl<T> Send for QualityItem<T>where
T: Send,
impl<T> Sync for QualityItem<T>where
T: Sync,
impl<T> Unpin for QualityItem<T>where
T: Unpin,
impl<T> UnwindSafe for QualityItem<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