Struct cookie_store::CookieStore [−][src]
pub struct CookieStore { /* fields omitted */ }
Expand description
Implementations
impl CookieStore
[src]
impl CookieStore
[src]pub fn get_request_cookies(
&self,
url: &Url
) -> impl Iterator<Item = &RawCookie<'static>>
[src]
👎 Deprecated since 0.14.1: Please use the get_request_values
function instead
pub fn get_request_cookies(
&self,
url: &Url
) -> impl Iterator<Item = &RawCookie<'static>>
[src]Please use the get_request_values
function instead
Return an Iterator
of the cookies for url
in the store, suitable for submitting in an
HTTP request. As the items are intended for use in creating a Cookie
header in a GET request,
they may contain only the name
and value
of a received cookie, eliding other parameters
such as path
or expires
. For iteration over Cookie
instances containing all data, please
refer to CookieStore::matches
.
pub fn get_request_values(
&self,
url: &Url
) -> impl Iterator<Item = (&str, &str)>
[src]
pub fn get_request_values(
&self,
url: &Url
) -> impl Iterator<Item = (&str, &str)>
[src]Return an Iterator
of the cookie (name
, value
) pairs for url
in the store, suitable
for use in the Cookie
header of an HTTP request. For iteration over Cookie
instances,
please refer to CookieStore::matches
.
pub fn store_response_cookies<I: Iterator<Item = RawCookie<'static>>>(
&mut self,
cookies: I,
url: &Url
)
[src]
pub fn store_response_cookies<I: Iterator<Item = RawCookie<'static>>>(
&mut self,
cookies: I,
url: &Url
)
[src]Store the cookies
received from url
pub fn with_suffix_list(self, psl: List) -> CookieStore
[src]
pub fn with_suffix_list(self, psl: List) -> CookieStore
[src]Specify a publicsuffix::List
for the CookieStore
to allow public suffix
matching
pub fn contains(&self, domain: &str, path: &str, name: &str) -> bool
[src]
pub fn contains(&self, domain: &str, path: &str, name: &str) -> bool
[src]Returns true if the CookieStore
contains an unexpired Cookie
corresponding to the
specified domain
, path
, and name
.
pub fn contains_any(&self, domain: &str, path: &str, name: &str) -> bool
[src]
pub fn contains_any(&self, domain: &str, path: &str, name: &str) -> bool
[src]Returns true if the CookieStore
contains any (even an expired) Cookie
corresponding
to the specified domain
, path
, and name
.
pub fn get(&self, domain: &str, path: &str, name: &str) -> Option<&Cookie<'_>>
[src]
pub fn get(&self, domain: &str, path: &str, name: &str) -> Option<&Cookie<'_>>
[src]Returns a reference to the unexpired Cookie
corresponding to the specified domain
,
path
, and name
.
pub fn get_any(
&self,
domain: &str,
path: &str,
name: &str
) -> Option<&Cookie<'static>>
[src]
pub fn get_any(
&self,
domain: &str,
path: &str,
name: &str
) -> Option<&Cookie<'static>>
[src]Returns a reference to the (possibly expired) Cookie
corresponding to the specified
domain
, path
, and name
.
pub fn remove(
&mut self,
domain: &str,
path: &str,
name: &str
) -> Option<Cookie<'static>>
[src]
pub fn remove(
&mut self,
domain: &str,
path: &str,
name: &str
) -> Option<Cookie<'static>>
[src]Removes a Cookie
from the store, returning the Cookie
if it was in the store
pub fn matches(&self, request_url: &Url) -> Vec<&Cookie<'static>>
[src]
pub fn matches(&self, request_url: &Url) -> Vec<&Cookie<'static>>
[src]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
.
pub fn parse(
&mut self,
cookie_str: &str,
request_url: &Url
) -> Result<StoreAction, CookieError>
[src]
pub fn parse(
&mut self,
cookie_str: &str,
request_url: &Url
) -> Result<StoreAction, CookieError>
[src]Parses a new Cookie
from cookie_str
and inserts it into the store.
pub fn insert_raw(
&mut self,
cookie: &RawCookie<'_>,
request_url: &Url
) -> Result<StoreAction, CookieError>
[src]
pub fn insert_raw(
&mut self,
cookie: &RawCookie<'_>,
request_url: &Url
) -> Result<StoreAction, CookieError>
[src]Converts a cookie::Cookie
(from the cookie
crate) into a cookie_store::Cookie
and
inserts it into the store.
pub fn insert(
&mut self,
cookie: Cookie<'static>,
request_url: &Url
) -> Result<StoreAction, CookieError>
[src]
pub fn insert(
&mut self,
cookie: Cookie<'static>,
request_url: &Url
) -> Result<StoreAction, CookieError>
[src]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.
pub fn iter_unexpired<'a>(
&'a self
) -> impl Iterator<Item = &'a Cookie<'static>> + 'a
[src]
pub fn iter_unexpired<'a>(
&'a self
) -> impl Iterator<Item = &'a Cookie<'static>> + 'a
[src]An iterator visiting all the unexpired cookies in the store
pub fn iter_any<'a>(&'a self) -> impl Iterator<Item = &'a Cookie<'static>> + 'a
[src]
pub fn iter_any<'a>(&'a self) -> impl Iterator<Item = &'a Cookie<'static>> + 'a
[src]An iterator visiting all (including expired) cookies in the store
pub fn save<W, E, F>(
&self,
writer: &mut W,
cookie_to_string: F
) -> Result<(), Error> where
W: Write,
F: Fn(&Cookie<'static>) -> Result<String, E>,
Error: From<E>,
[src]
pub fn save<W, E, F>(
&self,
writer: &mut W,
cookie_to_string: F
) -> Result<(), Error> where
W: Write,
F: Fn(&Cookie<'static>) -> Result<String, E>,
Error: From<E>,
[src]Serialize any unexpired and persistent cookies in the store with cookie_to_string
and write them to writer
pub fn save_json<W: Write>(&self, writer: &mut W) -> Result<(), Error>
[src]
pub fn save_json<W: Write>(&self, writer: &mut W) -> Result<(), Error>
[src]Serialize any unexpired and persistent cookies in the store to JSON format and
write them to writer
Trait Implementations
impl Debug for CookieStore
[src]
impl Debug for CookieStore
[src]impl Default for CookieStore
[src]
impl Default for CookieStore
[src]fn default() -> CookieStore
[src]
fn default() -> CookieStore
[src]Returns the “default value” for a type. Read more
impl<'de> Deserialize<'de> for CookieStore
[src]
impl<'de> Deserialize<'de> for CookieStore
[src]fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl Serialize for CookieStore
[src]
impl Serialize for CookieStore
[src]Auto Trait Implementations
impl RefUnwindSafe for CookieStore
impl Send for CookieStore
impl Sync for CookieStore
impl Unpin for CookieStore
impl UnwindSafe for CookieStore
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,