[][src]Struct isahc::cookies::CookieJar

pub struct CookieJar { /* fields omitted */ }

Provides automatic cookie session management using an in-memory cookie store.

Cookie jars are designed to be shareable across many concurrent requests, so cloning the jar simply returns a new reference to the jar instead of doing a deep clone.

This cookie jar implementation seeks to conform to the rules for client state management as described in RFC 6265.

Domain isolation

Cookies are isolated from each other based on the domain and path they are received from. As such, most methods require you to specify a URI, since unrelated websites can have cookies with the same name without conflict.

Implementations

impl CookieJar[src]

pub fn new() -> Self[src]

Create a new, empty cookie jar.

pub fn get_by_name(&self, uri: &Uri, cookie_name: &str) -> Option<Cookie>[src]

Get a cookie by name for the given URI.

pub fn get_for_uri(&self, uri: &Uri) -> impl IntoIterator<Item = Cookie>[src]

Get a copy of all the cookies in the jar that match the given URI.

The returned collection contains a copy of all the cookies matching the URI at the time this function was called. The collection is not a "live" view into the cookie jar; concurrent changes made to the jar (cookies inserted or removed) will not be reflected in the collection.

pub fn clear(&self)[src]

Remove all cookies from this cookie jar.

Trait Implementations

impl Clone for CookieJar[src]

impl Debug for CookieJar[src]

impl Default for CookieJar[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithSubscriber for T[src]