pub struct Downlink(/* private fields */);Expand description
Sec-CH-Downlink client hint: the approximate downstream speed of the
user’s connection, in megabits per second (Mbps).
The value is rounded to the nearest 25 kbps to limit fingerprinting. See the Network Information API.
Corresponds to ClientHint::Downlink; encoded as Sec-CH-Downlink.
§Example
use rama_http_headers::Downlink;
let downlink = Downlink::new(1.6);
assert_eq!(downlink.as_mbps(), 1.6);Implementations§
Trait Implementations§
impl Copy for Downlink
Source§impl HeaderDecode for Downlink
impl HeaderDecode for Downlink
Source§fn decode<'i, I: Iterator<Item = &'i HeaderValue>>(
values: &mut I,
) -> Result<Self, Error>
fn decode<'i, I: Iterator<Item = &'i HeaderValue>>( values: &mut I, ) -> Result<Self, Error>
Decode this type from an iterator of
HeaderValues.Source§impl HeaderEncode for Downlink
impl HeaderEncode for Downlink
Source§fn encode<E: Extend<HeaderValue>>(&self, values: &mut E)
fn encode<E: Extend<HeaderValue>>(&self, values: &mut E)
Encode this type to a
HeaderValue, and add it to a container
which has HeaderValue type as each element. Read moreSource§fn encode_to_value(&self) -> Option<HeaderValue>
fn encode_to_value(&self) -> Option<HeaderValue>
Encode this header to
HeaderValue. Read moreSource§impl PartialOrd for Downlink
impl PartialOrd for Downlink
impl StructuralPartialEq for Downlink
Source§impl TypedHeader for Downlink
impl TypedHeader for Downlink
Source§fn name() -> &'static HeaderName
fn name() -> &'static HeaderName
The name of this header.
Auto Trait Implementations§
impl Freeze for Downlink
impl RefUnwindSafe for Downlink
impl Send for Downlink
impl Sync for Downlink
impl Unpin for Downlink
impl UnsafeUnpin for Downlink
impl UnwindSafe for Downlink
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> 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