Struct http_types::security::TimingAllowOrigin[][src]

pub struct TimingAllowOrigin { /* fields omitted */ }
Expand description

Specify origins that are allowed to see values via the Resource Timing API.

Examples

use http_types::{Response, Url};
use http_types::security::TimingAllowOrigin;

let mut origins = TimingAllowOrigin::new();
origins.push(Url::parse("https://example.com")?);

let mut res = Response::new(200);
origins.apply(&mut res);

let origins = TimingAllowOrigin::from_headers(res)?.unwrap();
let origin = origins.iter().next().unwrap();
assert_eq!(origin, &Url::parse("https://example.com")?);

Implementations

Create a new instance of AllowOrigin.

Create an instance of AllowOrigin from a Headers instance.

Implementation note

A header value of "null" is treated the same as if no header was sent.

Append an origin to the list of origins.

Insert a HeaderName + HeaderValue pair into a Headers instance.

Get the HeaderName.

Get the HeaderValue.

Returns true if a wildcard directive was set.

Set the wildcard directive.

An iterator visiting all server timings.

An iterator visiting all server timings.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Returned iterator over header values which this type may correspond to.

Converts this object to an iterator of resolved HeaderValues.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.