pub struct Cookie { /* private fields */ }Expand description
A cookie to send with a response.
Implementations§
Source§impl Cookie
impl Cookie
pub fn new(name: impl Into<String>, value: impl Into<String>) -> Self
Sourcepub fn removal(name: impl Into<String>) -> Self
pub fn removal(name: impl Into<String>) -> Self
A cookie that instructs the client to discard it.
pub fn path(self, path: impl Into<String>) -> Self
pub fn max_age(self, seconds: i64) -> Self
Sourcepub fn http_only(self, http_only: bool) -> Self
pub fn http_only(self, http_only: bool) -> Self
Allow JavaScript to read it. Rarely what you want.
pub fn same_site(self, same_site: SameSite) -> Self
pub fn render(&self) -> String
Trait Implementations§
impl Eq for Cookie
impl StructuralPartialEq for Cookie
Auto Trait Implementations§
impl Freeze for Cookie
impl RefUnwindSafe for Cookie
impl Send for Cookie
impl Sync for Cookie
impl Unpin for Cookie
impl UnsafeUnpin for Cookie
impl UnwindSafe for Cookie
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.