Enum soup::CookieJarAcceptPolicy
source · #[non_exhaustive]pub enum CookieJarAcceptPolicy {
Always,
Never,
NoThirdParty,
GrandfatheredThirdParty,
}
Expand description
The policy for accepting or rejecting cookies returned in responses.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Always
accept all cookies unconditionally.
Never
reject all cookies unconditionally.
NoThirdParty
accept all cookies set by the main
document loaded in the application using libsoup. An example of the most
common case, web browsers, would be: If http://www.example.com is the page
loaded, accept all cookies set by example.com, but if a resource from
http://www.third-party.com is loaded from that page reject any cookie that
it could try to set. For libsoup to be able to tell apart first party
cookies from the rest, the application must call
Message::set_first_party()
on each outgoing Message
, setting
the glib::Uri
of the main document. If no first party is set in a
message when this policy is in effect, cookies will be assumed to be third
party by default.
GrandfatheredThirdParty
accept all cookies set by
the main document loaded in the application using libsoup, and from domains
that have previously set at least one cookie when loaded as the main
document. An example of the most common case, web browsers, would be: if
http://www.example.com is the page loaded, accept all cookies set by
example.com, but if a resource from http://www.third-party.com is loaded
from that page, reject any cookie that it could try to set unless it
already has a cookie in the cookie jar. For libsoup to be able to tell
apart first party cookies from the rest, the application must call
Message::set_first_party()
on each outgoing #SoupMessage, setting the
glib::Uri
of the main document. If no first party is set in a
message when this policy is in effect, cookies will be assumed to be third
party by default.
Trait Implementations§
source§impl Clone for CookieJarAcceptPolicy
impl Clone for CookieJarAcceptPolicy
source§fn clone(&self) -> CookieJarAcceptPolicy
fn clone(&self) -> CookieJarAcceptPolicy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CookieJarAcceptPolicy
impl Debug for CookieJarAcceptPolicy
source§impl From<CookieJarAcceptPolicy> for Value
impl From<CookieJarAcceptPolicy> for Value
source§fn from(v: CookieJarAcceptPolicy) -> Self
fn from(v: CookieJarAcceptPolicy) -> Self
source§impl<'a> FromValue<'a> for CookieJarAcceptPolicy
impl<'a> FromValue<'a> for CookieJarAcceptPolicy
§type Checker = GenericValueTypeChecker<CookieJarAcceptPolicy>
type Checker = GenericValueTypeChecker<CookieJarAcceptPolicy>
source§unsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Value
. Read moresource§impl HasParamSpec for CookieJarAcceptPolicy
impl HasParamSpec for CookieJarAcceptPolicy
type ParamSpec = ParamSpecEnum
§type SetValue = CookieJarAcceptPolicy
type SetValue = CookieJarAcceptPolicy
type BuilderFn = fn(_: &str, _: CookieJarAcceptPolicy) -> ParamSpecEnumBuilder<'_, CookieJarAcceptPolicy>
fn param_spec_builder() -> Self::BuilderFn
source§impl Hash for CookieJarAcceptPolicy
impl Hash for CookieJarAcceptPolicy
source§impl Ord for CookieJarAcceptPolicy
impl Ord for CookieJarAcceptPolicy
source§fn cmp(&self, other: &CookieJarAcceptPolicy) -> Ordering
fn cmp(&self, other: &CookieJarAcceptPolicy) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for CookieJarAcceptPolicy
impl PartialEq for CookieJarAcceptPolicy
source§fn eq(&self, other: &CookieJarAcceptPolicy) -> bool
fn eq(&self, other: &CookieJarAcceptPolicy) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for CookieJarAcceptPolicy
impl PartialOrd for CookieJarAcceptPolicy
source§fn partial_cmp(&self, other: &CookieJarAcceptPolicy) -> Option<Ordering>
fn partial_cmp(&self, other: &CookieJarAcceptPolicy) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for CookieJarAcceptPolicy
impl StaticType for CookieJarAcceptPolicy
source§fn static_type() -> Type
fn static_type() -> Type
Self
.source§impl ToValue for CookieJarAcceptPolicy
impl ToValue for CookieJarAcceptPolicy
source§impl ValueType for CookieJarAcceptPolicy
impl ValueType for CookieJarAcceptPolicy
§type Type = CookieJarAcceptPolicy
type Type = CookieJarAcceptPolicy
Type
from. Read moreimpl Copy for CookieJarAcceptPolicy
impl Eq for CookieJarAcceptPolicy
impl StructuralPartialEq for CookieJarAcceptPolicy
Auto Trait Implementations§
impl RefUnwindSafe for CookieJarAcceptPolicy
impl Send for CookieJarAcceptPolicy
impl Sync for CookieJarAcceptPolicy
impl Unpin for CookieJarAcceptPolicy
impl UnwindSafe for CookieJarAcceptPolicy
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
source§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
source§impl<T> PropertyGet for Twhere
T: HasParamSpec,
impl<T> PropertyGet for Twhere
T: HasParamSpec,
source§impl<T> StaticTypeExt for Twhere
T: StaticType,
impl<T> StaticTypeExt for Twhere
T: StaticType,
source§fn ensure_type()
fn ensure_type()
source§impl<T> ToSendValue for T
impl<T> ToSendValue for T
source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue
clone of self
.