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§
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 for QualityItem<T>where
T: Clone,
impl<T> Clone for QualityItem<T>where
T: Clone,
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 for QualityItem<T>where
T: Debug,
impl<T> Debug for QualityItem<T>where
T: Debug,
source§impl<T> Display for QualityItem<T>where
T: Display,
impl<T> Display for QualityItem<T>where
T: Display,
source§impl<T> FromStr for QualityItem<T>where
T: FromStr,
impl<T> FromStr for QualityItem<T>where
T: FromStr,
§type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
source§fn from_str(s: &str) -> Result<QualityItem<T>, ParseError>
fn from_str(s: &str) -> Result<QualityItem<T>, ParseError>
Parses a string
s
to return a value of this type. Read moresource§impl<T> PartialEq<QualityItem<T>> for QualityItem<T>where
T: PartialEq<T>,
impl<T> PartialEq<QualityItem<T>> for QualityItem<T>where
T: PartialEq<T>,
source§fn eq(&self, other: &QualityItem<T>) -> bool
fn eq(&self, other: &QualityItem<T>) -> bool
source§impl<T> PartialOrd<QualityItem<T>> for QualityItem<T>where
T: PartialEq<T>,
impl<T> PartialOrd<QualityItem<T>> for QualityItem<T>where
T: PartialEq<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> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self
to an expression for Diesel’s query builder. Read more