pub struct Referer { /* private fields */ }
Expand description
Contains the address of the page making the request.
Important: Although this header has many innocent uses it can have undesirable consequences for user security and privacy.
§Specifications
§Examples
use http_types_rs::{Response, Url};
use http_types_rs::other::Referer;
let referer = Referer::new(Url::parse("https://example.net/")?);
let mut res = Response::new(200);
res.insert_header(&referer, &referer);
let base_url = Url::parse("https://example.net/")?;
let referer = Referer::from_headers(base_url, res)?.unwrap();
assert_eq!(referer.location(), &Url::parse("https://example.net/")?);
Implementations§
Trait Implementations§
Source§impl Header for Referer
impl Header for Referer
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 Referer
impl RefUnwindSafe for Referer
impl Send for Referer
impl Sync for Referer
impl Unpin for Referer
impl UnwindSafe for Referer
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
.