[][src]Struct user_agent::Session

pub struct Session<C: SessionClient> {
    pub client: C,
    pub store: CookieStore,
}

Fields

client: Cstore: CookieStore

Implementations

impl<C: SessionClient> Session<C>[src]

pub fn new(client: C) -> Self[src]

pub fn load<R, E, F>(
    client: C,
    reader: R,
    cookie_from_str: F
) -> Result<Session<C>, Box<dyn Error + Send + Sync>> where
    R: BufRead,
    F: Fn(&str) -> Result<Cookie<'static>, E>,
    E: Error + Send + Sync + 'static, 
[src]

pub fn load_json<R: BufRead>(
    client: C,
    reader: R
) -> Result<Session<C>, Box<dyn Error + Send + Sync>>
[src]

pub fn save<W, E, F>(
    &self,
    writer: &mut W,
    cookie_to_string: F
) -> Result<(), Box<dyn Error + Send + Sync>> where
    W: Write,
    F: Fn(&Cookie) -> Result<String, E>,
    E: Error + Send + Sync + 'static, 
[src]

pub fn save_json<W: Write>(
    &self,
    writer: &mut W
) -> Result<(), Box<dyn Error + Send + Sync>>
[src]

pub fn get_with<U, P>(
    &mut self,
    url: U,
    prepare: P
) -> Result<<C as SessionClient>::Response, <C as SessionClient>::SendError> where
    P: FnOnce(<C as SessionClient>::Request) -> <C as SessionClient>::Request,
    U: IntoUrl, 
[src]

pub fn put_with<U, P>(
    &mut self,
    url: U,
    prepare: P
) -> Result<<C as SessionClient>::Response, <C as SessionClient>::SendError> where
    P: FnOnce(<C as SessionClient>::Request) -> <C as SessionClient>::Request,
    U: IntoUrl, 
[src]

pub fn head_with<U, P>(
    &mut self,
    url: U,
    prepare: P
) -> Result<<C as SessionClient>::Response, <C as SessionClient>::SendError> where
    P: FnOnce(<C as SessionClient>::Request) -> <C as SessionClient>::Request,
    U: IntoUrl, 
[src]

pub fn delete_with<U, P>(
    &mut self,
    url: U,
    prepare: P
) -> Result<<C as SessionClient>::Response, <C as SessionClient>::SendError> where
    P: FnOnce(<C as SessionClient>::Request) -> <C as SessionClient>::Request,
    U: IntoUrl, 
[src]

pub fn post_with<U, P>(
    &mut self,
    url: U,
    prepare: P
) -> Result<<C as SessionClient>::Response, <C as SessionClient>::SendError> where
    P: FnOnce(<C as SessionClient>::Request) -> <C as SessionClient>::Request,
    U: IntoUrl, 
[src]

pub fn get<U>(
    &mut self,
    url: U
) -> Result<<C as SessionClient>::Response, <C as SessionClient>::SendError> where
    U: IntoUrl, 
[src]

pub fn put<U>(
    &mut self,
    url: U
) -> Result<<C as SessionClient>::Response, <C as SessionClient>::SendError> where
    U: IntoUrl, 
[src]

pub fn head<U>(
    &mut self,
    url: U
) -> Result<<C as SessionClient>::Response, <C as SessionClient>::SendError> where
    U: IntoUrl, 
[src]

pub fn delete<U>(
    &mut self,
    url: U
) -> Result<<C as SessionClient>::Response, <C as SessionClient>::SendError> where
    U: IntoUrl, 
[src]

pub fn post<U>(
    &mut self,
    url: U
) -> Result<<C as SessionClient>::Response, <C as SessionClient>::SendError> where
    U: IntoUrl, 
[src]

Auto Trait Implementations

impl<C> RefUnwindSafe for Session<C> where
    C: RefUnwindSafe

impl<C> Send for Session<C> where
    C: Send

impl<C> Sync for Session<C> where
    C: Sync

impl<C> Unpin for Session<C> where
    C: Unpin

impl<C> UnwindSafe for Session<C> where
    C: UnwindSafe

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Sealed<T> for T where
    T: ?Sized

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.