Struct mio_surf::http::other::Referer [−][src]
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::{Response, Url}; use http_types::other::Referer; let referer = Referer::new(Url::parse("https://example.net/")?); let mut res = Response::new(200); referer.apply(&mut res); 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
impl Referer
[src]
pub fn new(location: Url) -> Referer
[src]
Create a new instance of Referer
header.
pub fn from_headers<U>(
base_url: U,
headers: impl AsRef<Headers>
) -> Result<Option<Referer>, Error> where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
base_url: U,
headers: impl AsRef<Headers>
) -> Result<Option<Referer>, Error> where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
Create a new instance from headers.
pub fn apply(&self, headers: impl AsMut<Headers>)
[src]
Sets the header.
pub fn name(&self) -> HeaderName
[src]
Get the HeaderName
.
pub fn value(&self) -> HeaderValue
[src]
Get the HeaderValue
.
pub fn location(&self) -> &Url
[src]
Get the url.
pub fn set_location<U>(
&mut self,
location: U
) -> Result<(), <U as TryInto<Url>>::Error> where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
[src]
&mut self,
location: U
) -> Result<(), <U as TryInto<Url>>::Error> where
U: TryInto<Url>,
<U as TryInto<Url>>::Error: Debug,
Set the url.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Referer
[src]
impl Send for Referer
[src]
impl Sync for Referer
[src]
impl Unpin for Referer
[src]
impl UnwindSafe for Referer
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,