pub struct Weighted<'a> {
pub value: &'a [u8],
pub weight: QValue,
pub params: Params<'a>,
}Expand description
One member of a weighted list: a value, its weight, and its parameters.
§Examples
use parse_net::{negotiate::parse_weighted, Limits};
let w = parse_weighted(b"en-GB;q=0.7", &Limits::DEFAULT)?;
let m = w.iter().next().expect("one member");
assert_eq!((m.value, m.weight.thousandths(), m.params.len()), (&b"en-GB"[..], 700, 0));Fields§
§value: &'a [u8]The value (a coding, a charset, or a language range).
weight: QValueIts q, 1 when absent.
params: Params<'a>The parameters before q.
Trait Implementations§
impl<'a> Copy for Weighted<'a>
impl<'a> Eq for Weighted<'a>
impl<'a> StructuralPartialEq for Weighted<'a>
Auto Trait Implementations§
impl<'a> Freeze for Weighted<'a>
impl<'a> RefUnwindSafe for Weighted<'a>
impl<'a> Send for Weighted<'a>
impl<'a> Sync for Weighted<'a>
impl<'a> Unpin for Weighted<'a>
impl<'a> UnsafeUnpin for Weighted<'a>
impl<'a> UnwindSafe for Weighted<'a>
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