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: T
The actual contents of the field.
quality: Quality
The quality (client or server preference) for the value.
Implementations
sourceimpl<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
sourceimpl<T> Clone for QualityItem<T> where
T: Clone,
impl<T> Clone for QualityItem<T> where
T: Clone,
sourcefn clone(&self) -> QualityItem<T>
fn clone(&self) -> QualityItem<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T> Debug for QualityItem<T> where
T: Debug,
impl<T> Debug for QualityItem<T> where
T: Debug,
sourceimpl<T> Display for QualityItem<T> where
T: Display,
impl<T> Display for QualityItem<T> where
T: Display,
sourceimpl<T> FromStr for QualityItem<T> where
T: FromStr,
impl<T> FromStr for QualityItem<T> where
T: FromStr,
sourceimpl<T> PartialEq<QualityItem<T>> for QualityItem<T> where
T: PartialEq<T>,
impl<T> PartialEq<QualityItem<T>> for QualityItem<T> where
T: PartialEq<T>,
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &QualityItem<T>) -> bool
fn ne(&self, other: &QualityItem<T>) -> bool
This method tests for !=
.
sourceimpl<T> PartialOrd<QualityItem<T>> for QualityItem<T> where
T: PartialEq<T>,
impl<T> PartialOrd<QualityItem<T>> for QualityItem<T> where
T: PartialEq<T>,
sourcefn partial_cmp(&self, other: &QualityItem<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &QualityItem<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl<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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
sourcefn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
F: FnMut(T) -> U,
A: Array<Item = U>,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more