pub struct CookieSession<S> {
pub session_id: SessionId,
pub created_at: u64,
pub state: S,
}Fields§
§session_id: SessionId§created_at: u64§state: SImplementations§
Source§impl<S> CookieSession<S>
impl<S> CookieSession<S>
pub fn new(id: SessionId, created_at: u64, value: S) -> Self
pub fn from_extensions(extensions: &mut Extensions) -> Option<Self>
Trait Implementations§
Source§impl<S: Clone> Clone for CookieSession<S>
impl<S: Clone> Clone for CookieSession<S>
Source§fn clone(&self) -> CookieSession<S>
fn clone(&self) -> CookieSession<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: Debug> Debug for CookieSession<S>
impl<S: Debug> Debug for CookieSession<S>
Source§impl<S, T> FromRequestParts<S> for CookieSession<T>
impl<S, T> FromRequestParts<S> for CookieSession<T>
Source§type Rejection = StatusCode
type Rejection = StatusCode
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§async fn from_request_parts(
parts: &mut Parts,
_state: &S,
) -> Result<Self, StatusCode>
async fn from_request_parts( parts: &mut Parts, _state: &S, ) -> Result<Self, StatusCode>
Perform the extraction.
Source§impl<S> Hash for CookieSession<S>
impl<S> Hash for CookieSession<S>
Source§impl<S, T> OptionalFromRequestParts<S> for CookieSession<T>
impl<S, T> OptionalFromRequestParts<S> for CookieSession<T>
Source§impl<S> PartialEq for CookieSession<S>
impl<S> PartialEq for CookieSession<S>
impl<S> Eq for CookieSession<S>
Auto Trait Implementations§
impl<S> Freeze for CookieSession<S>where
S: Freeze,
impl<S> RefUnwindSafe for CookieSession<S>where
S: RefUnwindSafe,
impl<S> Send for CookieSession<S>where
S: Send,
impl<S> Sync for CookieSession<S>where
S: Sync,
impl<S> Unpin for CookieSession<S>where
S: Unpin,
impl<S> UnwindSafe for CookieSession<S>where
S: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§fn from_request(
req: Request<Body>,
state: &S,
) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
fn from_request( req: Request<Body>, state: &S, ) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
Perform the extraction.