pub struct ClearSiteData { /* private fields */ }
Expand description
Clear browsing data (cookies, storage, cache) associated with the requesting website.
§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§
Source§impl ClearSiteData
impl ClearSiteData
Sourcepub fn from_headers(headers: impl AsRef<Headers>) -> Result<Option<Self>>
pub fn from_headers(headers: impl AsRef<Headers>) -> Result<Option<Self>>
Create a new instance from headers.
Sourcepub fn name(&self) -> HeaderName
pub fn name(&self) -> HeaderName
Get the HeaderName
.
Sourcepub fn value(&self) -> HeaderValue
pub fn value(&self) -> HeaderValue
Get the HeaderValue
.
Sourcepub fn push(&mut self, directive: impl Into<ClearDirective>)
pub fn push(&mut self, directive: impl Into<ClearDirective>)
Push a directive into the list of entries.
Sourcepub fn set_wildcard(&mut self, wildcard: bool)
pub fn set_wildcard(&mut self, wildcard: bool)
Set the wildcard directive.
Trait Implementations§
Source§impl Debug for ClearSiteData
impl Debug for ClearSiteData
Source§impl<'a> IntoIterator for &'a ClearSiteData
impl<'a> IntoIterator for &'a ClearSiteData
Source§impl<'a> IntoIterator for &'a mut ClearSiteData
impl<'a> IntoIterator for &'a mut ClearSiteData
Source§impl IntoIterator for ClearSiteData
impl IntoIterator for ClearSiteData
Source§impl ToHeaderValues for ClearSiteData
impl ToHeaderValues for ClearSiteData
Source§type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
Source§fn to_header_values(&self) -> Result<Self::Iter>
fn to_header_values(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved
HeaderValues
.Auto Trait Implementations§
impl Freeze for ClearSiteData
impl RefUnwindSafe for ClearSiteData
impl Send for ClearSiteData
impl Sync for ClearSiteData
impl Unpin for ClearSiteData
impl UnwindSafe for ClearSiteData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more