pub struct WithSession<T: Reply> { /* private fields */ }
Expand description
WithSession is a warp::Reply that attaches a session ID in the form of a Set-Cookie header to an existing warp::Reply
Implementations§
Source§impl<T> WithSession<T>where
T: Reply,
impl<T> WithSession<T>where
T: Reply,
Sourcepub async fn new<S: SessionStore>(
reply: T,
session_with_store: SessionWithStore<S>,
) -> Result<WithSession<T>, Rejection>
pub async fn new<S: SessionStore>( reply: T, session_with_store: SessionWithStore<S>, ) -> Result<WithSession<T>, Rejection>
This function binds a session to a warp::Reply. It takes the given session and binds it to the given warp::Reply by attaching a Set-Cookie header to it. This cookie contains the session ID. If the session was destroyed, it handles destroying the session in the store and removing the cookie.
Trait Implementations§
Source§impl<T> Reply for WithSession<T>where
T: Reply,
impl<T> Reply for WithSession<T>where
T: Reply,
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Converts the given value into a
Response
.Auto Trait Implementations§
impl<T> Freeze for WithSession<T>where
T: Freeze,
impl<T> RefUnwindSafe for WithSession<T>where
T: RefUnwindSafe,
impl<T> Send for WithSession<T>
impl<T> Sync for WithSession<T>where
T: Sync,
impl<T> Unpin for WithSession<T>where
T: Unpin,
impl<T> UnwindSafe for WithSession<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more