Struct trillium_http_types::other::Referer[][src]

pub struct Referer { /* fields omitted */ }
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.

MDN Documentation

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);
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

Create a new instance of Referer header.

Create a new instance from headers.

Get the url.

Set the url.

Trait Implementations

Formats the value using the given formatter. Read more

Access the header’s name.

Access the header’s value.

Insert the header name and header value into something that looks like a Headers map. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.