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 duplicate 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§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> PartialEq for QualityItem<T>
impl<T: PartialEq> PartialEq for QualityItem<T>
Source§impl<T: PartialEq> PartialOrd for QualityItem<T>
impl<T: PartialEq> PartialOrd for QualityItem<T>
impl<T> StructuralPartialEq for QualityItem<T>
Auto Trait Implementations§
impl<T> Freeze for QualityItem<T>where
T: Freeze,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more