pub struct ContentLength { /* private fields */ }
Expand description
The size of the entity-body, in bytes, sent to the recipient.
§Specifications
§Examples
use http_types_rs::Response;
use http_types_rs::content::{ContentLength};
let content_len = ContentLength::new(12);
let mut res = Response::new(200);
res.insert_header(&content_len, &content_len);
let content_len = ContentLength::from_headers(res)?.unwrap();
assert_eq!(content_len.len(), 12);
Implementations§
Source§impl ContentLength
impl ContentLength
Trait Implementations§
Source§impl Debug for ContentLength
impl Debug for ContentLength
Source§impl Header for ContentLength
impl Header for ContentLength
Source§fn header_name(&self) -> HeaderName
fn header_name(&self) -> HeaderName
Access the header’s name.
Source§fn header_value(&self) -> HeaderValue
fn header_value(&self) -> HeaderValue
Access the header’s value.
Auto Trait Implementations§
impl Freeze for ContentLength
impl RefUnwindSafe for ContentLength
impl Send for ContentLength
impl Sync for ContentLength
impl Unpin for ContentLength
impl UnwindSafe for ContentLength
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> ToHeaderValues for Twhere
T: Header,
impl<T> ToHeaderValues for Twhere
T: Header,
Source§type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
Source§fn to_header_values(&self) -> Result<<T as ToHeaderValues>::Iter, Error>
fn to_header_values(&self) -> Result<<T as ToHeaderValues>::Iter, Error>
Converts this object to an iterator of resolved
HeaderValues
.