[−][src]Struct wasm_cookies::CookieOptions
Cookies options (see https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie).
You can create it by calling CookieOptions::default()
.
Fields
path: Option<&'a str>
If None
, defaults to the current path of the current document location.
domain: Option<&'a str>
If None
, defaults to the host portion of the current document location.
expires: Option<String>
Expiration date in GMT string format.
If None
, the cookie will expire at the end of session.
secure: bool
If true, the cookie will only be transmitted over secure protocol as HTTPS. The default value is false.
same_site: SameSite
SameSite prevents the browser from sending the cookie along with cross-site requests (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_attribute).
Implementations
impl<'a> CookieOptions<'a>
[src]
pub fn with_path(self, path: &'a str) -> Self
[src]
Set the path. The default value is the current path of the current document location.
pub fn with_domain(self, domain: &'a str) -> Self
[src]
Set the domain. The default value is the host portion of the current document location.
pub fn expires_at_date(self, date: &Date) -> Self
[src]
Expires the cookie at a specific date. The default behavior of the cookie is to expire at the end of session.
pub fn expires_at_timestamp(self, timestamp: u64) -> Self
[src]
Expires the cookie at a specific timestamp (in seconds). The default behavior of the cookie is to expire at the end of session.
pub fn expires_after(self, duration: Duration) -> Self
[src]
Expires the cookie after a certain duration. The default behavior of the cookie is to expire at the end of session.
pub fn secure(self) -> Self
[src]
Set the cookie to be only transmitted over secure protocol as HTTPS.
pub fn with_same_site(self, same_site: SameSite) -> Self
[src]
Set the SameSite value. SameSite prevents the browser from sending the cookie along with cross-site requests (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#SameSite_attribute).
Trait Implementations
impl<'a> Clone for CookieOptions<'a>
[src]
fn clone(&self) -> CookieOptions<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for CookieOptions<'a>
[src]
impl<'a> Default for CookieOptions<'a>
[src]
fn default() -> CookieOptions<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for CookieOptions<'a>
impl<'a> Send for CookieOptions<'a>
impl<'a> Sync for CookieOptions<'a>
impl<'a> Unpin for CookieOptions<'a>
impl<'a> UnwindSafe for CookieOptions<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,