Enum cookie_store::CookieDomain
source · [−]Expand description
The domain of a Cookie
Variants
HostOnly(String)
No Domain attribute in Set-Cookie header
Suffix(String)
Domain attribute from Set-Cookie header
NotPresent
Domain attribute was not present in the Set-Cookie header
Empty
Domain attribute-value was empty; technically undefined behavior, but suggested that this be treated as invalid
Implementations
sourceimpl CookieDomain
impl CookieDomain
The concept of a domain match per IETF RFC6265 Section 5.1.3
sourcepub fn host_only(request_url: &Url) -> Result<CookieDomain, CookieError>
pub fn host_only(request_url: &Url) -> Result<CookieDomain, CookieError>
Get the CookieDomain::HostOnly variant based on request_url
. This is the effective behavior of
setting the domain-attribute to empty
sourcepub fn matches(&self, request_url: &Url) -> bool
pub fn matches(&self, request_url: &Url) -> bool
Tests if the given url::Url
meets the domain-match criteria
sourcepub fn host_is_identical(&self, request_url: &Url) -> bool
pub fn host_is_identical(&self, request_url: &Url) -> bool
Tests if the given url::Url
has a request-host identical to the domain attribute
sourcepub fn is_public_suffix(&self, psl: &List) -> bool
pub fn is_public_suffix(&self, psl: &List) -> bool
Tests if the domain-attribute is a public suffix as indicated by the provided
publicsuffix::List
.
Trait Implementations
sourceimpl Clone for CookieDomain
impl Clone for CookieDomain
sourcefn clone(&self) -> CookieDomain
fn clone(&self) -> CookieDomain
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CookieDomain
impl Debug for CookieDomain
sourceimpl<'de> Deserialize<'de> for CookieDomain
impl<'de> Deserialize<'de> for CookieDomain
sourcefn 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
sourceimpl<'a> From<&'a CookieDomain> for String
impl<'a> From<&'a CookieDomain> for String
sourcefn from(c: &'a CookieDomain) -> String
fn from(c: &'a CookieDomain) -> String
Converts to this type from the input type.
sourceimpl Hash for CookieDomain
impl Hash for CookieDomain
sourceimpl Ord for CookieDomain
impl Ord for CookieDomain
sourceimpl PartialEq<CookieDomain> for CookieDomain
impl PartialEq<CookieDomain> for CookieDomain
sourcefn eq(&self, other: &CookieDomain) -> bool
fn eq(&self, other: &CookieDomain) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CookieDomain) -> bool
fn ne(&self, other: &CookieDomain) -> bool
This method tests for !=
.
sourceimpl PartialOrd<CookieDomain> for CookieDomain
impl PartialOrd<CookieDomain> for CookieDomain
sourcefn partial_cmp(&self, other: &CookieDomain) -> Option<Ordering>
fn partial_cmp(&self, other: &CookieDomain) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Serialize for CookieDomain
impl Serialize for CookieDomain
sourceimpl<'a, 'c> TryFrom<&'a Cookie<'c>> for CookieDomain
impl<'a, 'c> TryFrom<&'a Cookie<'c>> for CookieDomain
Construct a CookieDomain::Suffix
from a cookie::Cookie
, which handles stripping a leading
‘.’ for us. If the cookie.domain is None or an empty string, the CookieDomain::Empty
variant
is returned.
NOTE: cookie::Cookie
domain values already have the leading ‘.’ stripped. To avoid
performing this step twice, the From<&cookie::Cookie>
impl should be used,
instead of passing cookie.domain
to the From<&str>
impl.
sourceimpl<'a> TryFrom<&'a str> for CookieDomain
impl<'a> TryFrom<&'a str> for CookieDomain
Construct a CookieDomain::Suffix
from a string, stripping a single leading ‘.’ if present.
If the source string is empty, returns the CookieDomain::Empty
variant.
impl Eq for CookieDomain
impl StructuralEq for CookieDomain
impl StructuralPartialEq for CookieDomain
Auto Trait Implementations
impl RefUnwindSafe for CookieDomain
impl Send for CookieDomain
impl Sync for CookieDomain
impl Unpin for CookieDomain
impl UnwindSafe for CookieDomain
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more