pub struct Cookie<'a> { /* private fields */ }Expand description
Cookie object
Implementations§
Source§impl<'a> Cookie<'a>
impl<'a> Cookie<'a>
Sourcepub fn builder(
name: impl Into<Cow<'a, str>>,
value: impl Into<Cow<'a, str>>,
domain: impl Into<Cow<'a, str>>,
path: impl Into<Cow<'a, str>>,
expires: f64,
size: u64,
http_only: bool,
secure: bool,
session: bool,
priority: impl Into<CookiePriority>,
source_scheme: impl Into<CookieSourceScheme>,
source_port: i64,
) -> CookieBuilder<'a>
pub fn builder( name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>, domain: impl Into<Cow<'a, str>>, path: impl Into<Cow<'a, str>>, expires: f64, size: u64, http_only: bool, secure: bool, session: bool, priority: impl Into<CookiePriority>, source_scheme: impl Into<CookieSourceScheme>, source_port: i64, ) -> CookieBuilder<'a>
Creates a builder for this type with the required parameters:
name: Cookie name.value: Cookie value.domain: Cookie domain.path: Cookie path.expires: Cookie expiration date as the number of seconds since the UNIX epoch. The value is set to -1 if the expiry date is not set. The value can be null for values that cannot be represented in JSON (±Inf).size: Cookie size.http_only: True if cookie is http-only.secure: True if cookie is secure.session: True in case of session cookie.priority: Cookie Prioritysource_scheme: Cookie source scheme type.source_port: Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
Sourcepub fn expires(&self) -> f64
pub fn expires(&self) -> f64
Cookie expiration date as the number of seconds since the UNIX epoch. The value is set to -1 if the expiry date is not set. The value can be null for values that cannot be represented in JSON (±Inf).
Sourcepub fn same_site(&self) -> Option<&CookieSameSite>
pub fn same_site(&self) -> Option<&CookieSameSite>
Cookie SameSite type.
Sourcepub fn priority(&self) -> &CookiePriority
pub fn priority(&self) -> &CookiePriority
Cookie Priority
Sourcepub fn source_scheme(&self) -> &CookieSourceScheme
pub fn source_scheme(&self) -> &CookieSourceScheme
Cookie source scheme type.
Sourcepub fn source_port(&self) -> i64
pub fn source_port(&self) -> i64
Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
Sourcepub fn partition_key(&self) -> Option<&CookiePartitionKey<'a>>
pub fn partition_key(&self) -> Option<&CookiePartitionKey<'a>>
Cookie partition key.
Sourcepub fn partition_key_opaque(&self) -> Option<bool>
pub fn partition_key_opaque(&self) -> Option<bool>
True if cookie partition key is opaque.
Trait Implementations§
Source§impl<'de, 'a> Deserialize<'de> for Cookie<'a>
impl<'de, 'a> Deserialize<'de> for Cookie<'a>
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
Auto Trait Implementations§
impl<'a> Freeze for Cookie<'a>
impl<'a> RefUnwindSafe for Cookie<'a>
impl<'a> Send for Cookie<'a>
impl<'a> Sync for Cookie<'a>
impl<'a> Unpin for Cookie<'a>
impl<'a> UnsafeUnpin for Cookie<'a>
impl<'a> UnwindSafe for Cookie<'a>
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