Type Definition user_agent::ReqwestSession
source · Methods from Deref<Target = CookieStore>
Return an Iterator
of the cookies for url
in the store
Store the cookies
received from url
sourcepub fn contains(&self, domain: &str, path: &str, name: &str) -> bool
pub fn contains(&self, domain: &str, path: &str, name: &str) -> bool
Returns true if the CookieStore
contains an unexpired Cookie
corresponding to the
specified domain
, path
, and name
.
sourcepub fn contains_any(&self, domain: &str, path: &str, name: &str) -> bool
pub fn contains_any(&self, domain: &str, path: &str, name: &str) -> bool
Returns true if the CookieStore
contains any (even an expired) Cookie
corresponding
to the specified domain
, path
, and name
.
sourcepub fn get(&self, domain: &str, path: &str, name: &str) -> Option<&Cookie<'_>>
pub fn get(&self, domain: &str, path: &str, name: &str) -> Option<&Cookie<'_>>
Returns a reference to the unexpired Cookie
corresponding to the specified domain
,
path
, and name
.
sourcepub fn get_any(
&self,
domain: &str,
path: &str,
name: &str
) -> Option<&Cookie<'static>>
pub fn get_any(
&self,
domain: &str,
path: &str,
name: &str
) -> Option<&Cookie<'static>>
Returns a reference to the (possibly expired) Cookie
corresponding to the specified
domain
, path
, and name
.
sourcepub fn remove(
&mut self,
domain: &str,
path: &str,
name: &str
) -> Option<Cookie<'static>>
pub fn remove(
&mut self,
domain: &str,
path: &str,
name: &str
) -> Option<Cookie<'static>>
Removes a Cookie
from the store, returning the Cookie
if it was in the store
sourcepub fn matches(&self, request_url: &Url) -> Vec<&Cookie<'static>, Global>
pub fn matches(&self, request_url: &Url) -> Vec<&Cookie<'static>, Global>
Returns a collection of references to unexpired cookies that path- and domain-match
request_url
, as well as having HttpOnly and Secure attributes compatible with the
request_url
.
sourcepub fn parse(
&mut self,
cookie_str: &str,
request_url: &Url
) -> Result<StoreAction, Error>
pub fn parse(
&mut self,
cookie_str: &str,
request_url: &Url
) -> Result<StoreAction, Error>
Parses a new Cookie
from cookie_str
and inserts it into the store.
sourcepub fn insert_raw(
&mut self,
cookie: &Cookie<'_>,
request_url: &Url
) -> Result<StoreAction, Error>
pub fn insert_raw(
&mut self,
cookie: &Cookie<'_>,
request_url: &Url
) -> Result<StoreAction, Error>
Converts a cookie::Cookie
(from the cookie
crate) into a user_agent::Cookie
and
inserts it into the store.
sourcepub fn insert(
&mut self,
cookie: Cookie<'static>,
request_url: &Url
) -> Result<StoreAction, Error>
pub fn insert(
&mut self,
cookie: Cookie<'static>,
request_url: &Url
) -> Result<StoreAction, Error>
Inserts cookie
, received from request_url
, into the store, following the rules of the
IETF RFC6265 Storage Model. If the
Cookie
is unexpired and is successfully inserted, returns
Ok(StoreAction::Inserted)
. If the Cookie
is expired and matches an existing
Cookie
in the store, the existing Cookie
wil be expired()
and
Ok(StoreAction::ExpiredExisting)
will be returned.
sourcepub fn iter_unexpired<'a>(
&'a self
) -> impl Iterator<Item = &'a Cookie<'static>> + 'a
pub fn iter_unexpired<'a>(
&'a self
) -> impl Iterator<Item = &'a Cookie<'static>> + 'a
An iterator visiting all the unexpired cookies in the store
sourcepub fn iter_any<'a>(&'a self) -> impl Iterator<Item = &'a Cookie<'static>> + 'a
pub fn iter_any<'a>(&'a self) -> impl Iterator<Item = &'a Cookie<'static>> + 'a
An iterator visiting all (including expired) cookies in the store