Struct Session

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

Fields§

§client: C§store: CookieStore

Implementations§

Source§

impl<C: SessionClient> Session<C>

Source

pub fn new(client: C) -> Self

Source

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,

Source

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

Source

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,

Source

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

Source

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,

Source

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,

Source

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,

Source

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,

Source

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,

Source

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

Source

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

Source

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

Source

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

Source

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

Auto Trait Implementations§

§

impl<C> Freeze for Session<C>
where C: Freeze,

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,