pub struct CookieStore { /* private fields */ }
Expand description

An implementation for storing and retrieving Cookies per the path and domain matching rules specified in RFC6265.

Implementations

👎Deprecated since 0.14.1:

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.

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.

Store the cookies received from url

Specify a publicsuffix::List for the CookieStore to allow public suffix matching

Returns true if the CookieStore contains an unexpired Cookie corresponding to the specified domain, path, and name.

Returns true if the CookieStore contains any (even an expired) Cookie corresponding to the specified domain, path, and name.

Returns a reference to the unexpired Cookie corresponding to the specified domain, path, and name.

Returns a reference to the (possibly expired) Cookie corresponding to the specified domain, path, and name.

Removes a Cookie from the store, returning the Cookie if it was in the store

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.

Parses a new Cookie from cookie_str and inserts it into the store.

Converts a cookie::Cookie (from the cookie crate) into a cookie_store::Cookie and inserts it into the store.

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.

Clear the contents of the store

An iterator visiting all the unexpired cookies in the store

An iterator visiting all (including expired) cookies in the store

Serialize any unexpired and persistent cookies in the store with cookie_to_string and write them to writer

Serialize any unexpired and persistent cookies in the store to JSON format and write them to writer

Load cookies from reader, deserializing with cookie_from_str, skipping any expired cookies

Load cookies from reader, deserializing with cookie_from_str, loading both unexpired and expired cookies

Load JSON-formatted cookies from reader, skipping any expired cookies

Load JSON-formatted cookies from reader, loading both expired and unexpired cookies

Create a CookieStore from an iterator of Cookie values. When include_expired is true, both expired and unexpired cookies in the incoming iterator will be included in the produced CookieStore; otherwise, only unexpired cookies will be included, and expired cookies filtered out.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.