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 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.
Set the wildcard directive.
Trait Implementations
Access the header’s name.
Access the header’s value.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for TimingAllowOriginimpl Send for TimingAllowOriginimpl Sync for TimingAllowOriginimpl Unpin for TimingAllowOriginimpl UnwindSafe for TimingAllowOriginBlanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = TShould always be Self
pub fn vzip(self) -> V