Enum cookie_store::CookieExpiration
source · pub enum CookieExpiration {
AtUtc(OffsetDateTime),
SessionEnd,
}
Expand description
When a given Cookie
expires
Variants§
AtUtc(OffsetDateTime)
Cookie
expires at the given UTC time, as set from either the Max-Age
or Expires attribute of a Set-Cookie header
SessionEnd
Cookie
expires at the end of the current Session
; this means the cookie
is not persistent
Implementations§
source§impl CookieExpiration
impl CookieExpiration
sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Indicates if the Cookie
is expired as of now.
sourcepub fn expires_by(&self, utc_tm: &OffsetDateTime) -> bool
pub fn expires_by(&self, utc_tm: &OffsetDateTime) -> bool
Indicates if the Cookie
expires as of utc_tm
.
Trait Implementations§
source§impl Clone for CookieExpiration
impl Clone for CookieExpiration
source§fn clone(&self) -> CookieExpiration
fn clone(&self) -> CookieExpiration
Returns a copy 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 Debug for CookieExpiration
impl Debug for CookieExpiration
source§impl<'de> Deserialize<'de> for CookieExpiration
impl<'de> Deserialize<'de> for CookieExpiration
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Duration> for CookieExpiration
impl From<Duration> for CookieExpiration
source§impl From<Expiration> for CookieExpiration
impl From<Expiration> for CookieExpiration
source§fn from(expiration: Expiration) -> CookieExpiration
fn from(expiration: Expiration) -> CookieExpiration
Converts to this type from the input type.
source§impl From<OffsetDateTime> for CookieExpiration
impl From<OffsetDateTime> for CookieExpiration
source§fn from(utc_tm: OffsetDateTime) -> CookieExpiration
fn from(utc_tm: OffsetDateTime) -> CookieExpiration
Converts to this type from the input type.
source§impl From<u64> for CookieExpiration
impl From<u64> for CookieExpiration
source§fn from(max_age: u64) -> CookieExpiration
fn from(max_age: u64) -> CookieExpiration
Converts to this type from the input type.
source§impl PartialEq for CookieExpiration
impl PartialEq for CookieExpiration
source§impl Serialize for CookieExpiration
impl Serialize for CookieExpiration
impl Eq for CookieExpiration
Auto Trait Implementations§
impl Freeze for CookieExpiration
impl RefUnwindSafe for CookieExpiration
impl Send for CookieExpiration
impl Sync for CookieExpiration
impl Unpin for CookieExpiration
impl UnwindSafe for CookieExpiration
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