[−][src]Struct http_types::trace::AllowOrigin
Specify origins that are allowed to see values via the Resource Timing API.
Examples
use http_types::Response; use http_types::trace::{AllowOrigin, Origin}; let mut origins = AllowOrigin::new(); origins.push(Origin::Wildcard); let mut res = Response::new(200); origins.apply(&mut res); let origins = AllowOrigin::from_headers(res)?.unwrap(); let origin = origins.iter().next().unwrap(); assert_eq!(origin, &Origin::Wildcard);
Implementations
impl AllowOrigin[src]
pub fn new() -> Self[src]
Create a new instance of AllowOrigin.
pub fn from_headers(headers: impl AsRef<Headers>) -> Result<Option<Self>>[src]
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.
pub fn push(&mut self, origin: impl Into<Origin>)[src]
Append an origin to the list of origins.
pub fn apply(&self, headers: impl AsMut<Headers>)[src]
Insert a HeaderName + HeaderValue pair into a Headers instance.
pub fn name(&self) -> HeaderName[src]
Get the HeaderName.
pub fn value(&self) -> HeaderValue[src]
Get the HeaderValue.
pub fn iter(&self) -> Iterⓘ[src]
An iterator visiting all server timings.
pub fn iter_mut(&mut self) -> IterMutⓘ[src]
An iterator visiting all server timings.
Trait Implementations
impl Clone for AllowOrigin[src]
fn clone(&self) -> AllowOrigin[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for AllowOrigin[src]
impl Eq for AllowOrigin[src]
impl IntoIterator for AllowOrigin[src]
type Item = Origin
The type of the elements being iterated over.
type IntoIter = IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
impl<'a> IntoIterator for &'a AllowOrigin[src]
type Item = &'a Origin
The type of the elements being iterated over.
type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
impl<'a> IntoIterator for &'a mut AllowOrigin[src]
type Item = &'a mut Origin
The type of the elements being iterated over.
type IntoIter = IterMut<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
impl PartialEq<AllowOrigin> for AllowOrigin[src]
fn eq(&self, other: &AllowOrigin) -> bool[src]
fn ne(&self, other: &AllowOrigin) -> bool[src]
impl StructuralEq for AllowOrigin[src]
impl StructuralPartialEq for AllowOrigin[src]
impl ToHeaderValues for AllowOrigin[src]
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
fn to_header_values(&self) -> Result<Self::Iter>[src]
Auto Trait Implementations
impl RefUnwindSafe for AllowOrigin
impl Send for AllowOrigin
impl Sync for AllowOrigin
impl Unpin for AllowOrigin
impl UnwindSafe for AllowOrigin
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,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator, [src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
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.
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.
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>,