Struct trillium_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);
res.insert_header(&origins, &origins);

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.

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

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

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 !=.

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.