pub struct ClearSiteData { /* private fields */ }
Expand description
Clear browsing data (cookies, storage, cache) associated with the requesting website.
§Specifications
§Examples
use http_types_rs::Response;
use http_types_rs::cache::{ClearSiteData, ClearDirective};
let mut entries = ClearSiteData::new();
entries.push(ClearDirective::Cache);
entries.push(ClearDirective::Cookies);
let mut res = Response::new(200);
res.insert_header(&entries, &entries);
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 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 Header for ClearSiteData
impl Header for ClearSiteData
Source§fn header_name(&self) -> HeaderName
fn header_name(&self) -> HeaderName
Access the header’s name.
Source§fn header_value(&self) -> HeaderValue
fn header_value(&self) -> HeaderValue
Access the header’s value.
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
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
Source§impl<T> ToHeaderValues for Twhere
T: Header,
impl<T> ToHeaderValues for Twhere
T: Header,
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<<T as ToHeaderValues>::Iter, Error>
fn to_header_values(&self) -> Result<<T as ToHeaderValues>::Iter, Error>
Converts this object to an iterator of resolved
HeaderValues
.