pub struct ContentLocation { /* private fields */ }
Expand description
Indicates an alternate location for the returned data.
§Specifications
§Examples
use http_types_rs::{Response, Url};
use http_types_rs::content::ContentLocation;
let content_location = ContentLocation::new(Url::parse("https://example.net/")?);
let mut res = Response::new(200);
res.insert_header(&content_location, &content_location);
let url = Url::parse("https://example.net/")?;
let content_location = ContentLocation::from_headers(url, res)?.unwrap();
assert_eq!(content_location.location(), &Url::parse("https://example.net/")?);
Implementations§
Source§impl ContentLocation
impl ContentLocation
Trait Implementations§
Source§impl Debug for ContentLocation
impl Debug for ContentLocation
Source§impl Header for ContentLocation
impl Header for ContentLocation
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 ContentLocation
impl RefUnwindSafe for ContentLocation
impl Send for ContentLocation
impl Sync for ContentLocation
impl Unpin for ContentLocation
impl UnwindSafe for ContentLocation
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
.