Struct biscotti::ResponseCookieId
source · pub struct ResponseCookieId<'c> { /* private fields */ }
Expand description
A unique identifier for a ResponseCookie
.
It takes into account the name, domain, and path of the cookie.
§Example
use biscotti::ResponseCookieId;
let id = ResponseCookieId::new("name");
assert_eq!(id.name(), "name");
assert_eq!(id.domain(), None);
assert_eq!(id.path(), None);
let id = ResponseCookieId::new("name").set_domain("rust-lang.org").set_path("/");
assert_eq!(id.name(), "name");
assert_eq!(id.domain(), Some("rust-lang.org"));
assert_eq!(id.path(), Some("/"));
Implementations§
source§impl<'c> ResponseCookieId<'c>
impl<'c> ResponseCookieId<'c>
sourcepub fn new<N: Into<Cow<'c, str>>>(name: N) -> ResponseCookieId<'c>
pub fn new<N: Into<Cow<'c, str>>>(name: N) -> ResponseCookieId<'c>
Creates a new ResponseCookieId
with the given name.
sourcepub fn set_domain<P: Into<Cow<'c, str>>>(
self,
domain: P
) -> ResponseCookieId<'c>
pub fn set_domain<P: Into<Cow<'c, str>>>( self, domain: P ) -> ResponseCookieId<'c>
Sets the domain of the cookie.
sourcepub fn unset_domain(self) -> ResponseCookieId<'c>
pub fn unset_domain(self) -> ResponseCookieId<'c>
Unsets the domain of the cookie.
sourcepub fn set_path<P: Into<Cow<'c, str>>>(self, path: P) -> ResponseCookieId<'c>
pub fn set_path<P: Into<Cow<'c, str>>>(self, path: P) -> ResponseCookieId<'c>
Sets the path of the cookie.
sourcepub fn unset_path(self) -> ResponseCookieId<'c>
pub fn unset_path(self) -> ResponseCookieId<'c>
Unsets the path of the cookie.
Trait Implementations§
source§impl<'c> Clone for ResponseCookieId<'c>
impl<'c> Clone for ResponseCookieId<'c>
source§fn clone(&self) -> ResponseCookieId<'c>
fn clone(&self) -> ResponseCookieId<'c>
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<'c> Debug for ResponseCookieId<'c>
impl<'c> Debug for ResponseCookieId<'c>
source§impl<'a> From<&'a str> for ResponseCookieId<'a>
impl<'a> From<&'a str> for ResponseCookieId<'a>
source§fn from(value: &'a str) -> ResponseCookieId<'a>
fn from(value: &'a str) -> ResponseCookieId<'a>
Converts to this type from the input type.
source§impl<'c> From<ResponseCookieId<'c>> for RemovalCookie<'c>
impl<'c> From<ResponseCookieId<'c>> for RemovalCookie<'c>
source§fn from(value: ResponseCookieId<'c>) -> Self
fn from(value: ResponseCookieId<'c>) -> Self
Converts to this type from the input type.
source§impl<'c> Hash for ResponseCookieId<'c>
impl<'c> Hash for ResponseCookieId<'c>
source§impl<'c> PartialEq for ResponseCookieId<'c>
impl<'c> PartialEq for ResponseCookieId<'c>
source§fn eq(&self, other: &ResponseCookieId<'c>) -> bool
fn eq(&self, other: &ResponseCookieId<'c>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'c> Eq for ResponseCookieId<'c>
impl<'c> StructuralPartialEq for ResponseCookieId<'c>
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ResponseCookieId<'c>
impl<'c> Send for ResponseCookieId<'c>
impl<'c> Sync for ResponseCookieId<'c>
impl<'c> Unpin for ResponseCookieId<'c>
impl<'c> UnwindSafe for ResponseCookieId<'c>
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<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.