[][src]Struct tide::http::cache::ClearSiteData

pub struct ClearSiteData { /* fields omitted */ }

Clear browsing data (cookies, storage, cache) associated with the requesting website.

MDN Documentation

Specifications

Examples

use http_types::Response;
use http_types::cache::{ClearSiteData, ClearDirective};

let mut entries = ClearSiteData::new();
entries.push(ClearDirective::Cache);
entries.push(ClearDirective::Cookies);

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

let entries = ClearSiteData::from_headers(res)?.unwrap();
let mut entries = entries.iter();
assert_eq!(entries.next().unwrap(), &ClearDirective::Cache);
assert_eq!(entries.next().unwrap(), &ClearDirective::Cookies);

Implementations

impl ClearSiteData[src]

pub fn new() -> ClearSiteData[src]

Create a new instance of ClearSiteData.

pub fn from_headers(
    headers: impl AsRef<Headers>
) -> Result<Option<ClearSiteData>, Error>
[src]

Create a new instance from headers.

pub fn apply(&self, headers: impl AsMut<Headers>)[src]

Sets the If-Match header.

pub fn name(&self) -> HeaderName[src]

Get the HeaderName.

pub fn value(&self) -> HeaderValue[src]

Get the HeaderValue.

pub fn push(&mut self, directive: impl Into<ClearDirective>)[src]

Push a directive into the list of entries.

pub fn wildcard(&self) -> bool[src]

Returns true if a wildcard directive was set.

pub fn set_wildcard(&mut self, wildcard: bool)[src]

Set the wildcard directive.

pub fn iter(&self) -> Iter<'_>[src]

An iterator visiting all server entries.

pub fn iter_mut(&mut self) -> IterMut<'_>[src]

An iterator visiting all server entries.

Trait Implementations

impl Debug for ClearSiteData[src]

impl<'a> IntoIterator for &'a mut ClearSiteData[src]

type Item = &'a mut ClearDirective

The type of the elements being iterated over.

type IntoIter = IterMut<'a>

Which kind of iterator are we turning this into?

impl IntoIterator for ClearSiteData[src]

type Item = ClearDirective

The type of the elements being iterated over.

type IntoIter = IntoIter

Which kind of iterator are we turning this into?

impl<'a> IntoIterator for &'a ClearSiteData[src]

type Item = &'a ClearDirective

The type of the elements being iterated over.

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?

impl ToHeaderValues for ClearSiteData[src]

type Iter = IntoIter<HeaderValue>

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

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,