Struct pavex::cookie::ResponseCookieId
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§
§impl<'c> ResponseCookieId<'c>
impl<'c> ResponseCookieId<'c>
pub fn new<N>(name: N) -> ResponseCookieId<'c>
pub fn new<N>(name: N) -> ResponseCookieId<'c>
Creates a new ResponseCookieId
with the given name.
pub fn set_domain<P>(self, domain: P) -> ResponseCookieId<'c>
pub fn set_domain<P>(self, domain: P) -> ResponseCookieId<'c>
Sets the domain of the cookie.
pub fn unset_domain(self) -> ResponseCookieId<'c>
pub fn unset_domain(self) -> ResponseCookieId<'c>
Unsets the domain of the cookie.
pub fn set_path<P>(self, path: P) -> ResponseCookieId<'c>
pub fn set_path<P>(self, path: P) -> ResponseCookieId<'c>
Sets the path of the cookie.
pub fn unset_path(self) -> ResponseCookieId<'c>
pub fn unset_path(self) -> ResponseCookieId<'c>
Unsets the path of the cookie.
Trait Implementations§
§impl<'c> Clone for ResponseCookieId<'c>
impl<'c> Clone for ResponseCookieId<'c>
§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 more§impl<'c> Debug for ResponseCookieId<'c>
impl<'c> Debug for ResponseCookieId<'c>
§impl<'a> From<&'a str> for ResponseCookieId<'a>
impl<'a> From<&'a str> for ResponseCookieId<'a>
§fn from(value: &'a str) -> ResponseCookieId<'a>
fn from(value: &'a str) -> ResponseCookieId<'a>
Converts to this type from the input type.
§impl<'c> From<ResponseCookieId<'c>> for RemovalCookie<'c>
impl<'c> From<ResponseCookieId<'c>> for RemovalCookie<'c>
§fn from(value: ResponseCookieId<'c>) -> RemovalCookie<'c>
fn from(value: ResponseCookieId<'c>) -> RemovalCookie<'c>
Converts to this type from the input type.
§impl<'c> Hash for ResponseCookieId<'c>
impl<'c> Hash for ResponseCookieId<'c>
§impl<'c> PartialEq for ResponseCookieId<'c>
impl<'c> PartialEq for ResponseCookieId<'c>
impl<'c> Eq for ResponseCookieId<'c>
impl<'c> StructuralPartialEq for ResponseCookieId<'c>
Auto Trait Implementations§
impl<'c> Freeze for ResponseCookieId<'c>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.