Struct typed_headers::Quality [−][src]
pub struct Quality(_);
A quality value, as specified in RFC7231.
Quality values are decimal numbers between 0 and 1 (inclusive) with up to 3 fractional digits of precision.
Methods
impl Quality[src]
impl Qualitypub fn from_u16(quality: u16) -> Quality[src]
pub fn from_u16(quality: u16) -> QualityCreates a quality value from a value between 0 and 1000 inclusive.
This is semantically divided by 1000 to produce a value between 0 and 1.
Panics
Panics if the value is greater than 1000.
pub fn as_u16(&self) -> u16[src]
pub fn as_u16(&self) -> u16Returns the quality multiplied by 1000 as an integer.
Trait Implementations
impl Debug for Quality[src]
impl Debug for Qualityfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Copy for Quality[src]
impl Copy for Qualityimpl Clone for Quality[src]
impl Clone for Qualityfn clone(&self) -> Quality[src]
fn clone(&self) -> QualityReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl PartialEq for Quality[src]
impl PartialEq for Qualityfn eq(&self, other: &Quality) -> bool[src]
fn eq(&self, other: &Quality) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Quality) -> bool[src]
fn ne(&self, other: &Quality) -> boolThis method tests for !=.
impl Eq for Quality[src]
impl Eq for Qualityimpl PartialOrd for Quality[src]
impl PartialOrd for Qualityfn partial_cmp(&self, other: &Quality) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Quality) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &Quality) -> bool[src]
fn lt(&self, other: &Quality) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Quality) -> bool[src]
fn le(&self, other: &Quality) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &Quality) -> bool[src]
fn gt(&self, other: &Quality) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Quality) -> bool[src]
fn ge(&self, other: &Quality) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Ord for Quality[src]
impl Ord for Qualityfn cmp(&self, other: &Quality) -> Ordering[src]
fn cmp(&self, other: &Quality) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more