pub struct AccessPolicy {
pub geo: Vec<CountryCode>,
pub prefer_geo: Vec<CountryCode>,
pub ip_type: Option<EgressKind>,
pub session: Option<String>,
}Expand description
What a site needs from its egress. The default (empty) means “no special routing” — the request uses the client’s default egress.
Two flavours of geo constraint co-exist:
geo— hard. A site that won’t answer from anywhere else (e.g. a country-locked profile). No matching egress in the pool →Uncertain(GeoUnavailable), never a falseNotFound.prefer_geo— soft. A site that prefers a local egress (better recall, less aggressive bot filtering) but still works from anywhere. No matching egress → fall back to the default egress and probe normally. Auto-populated at registry-load time fromregion:XXtags when the site doesn’t already declare a hardgeoconstraint.
Fields§
§geo: Vec<CountryCode>Require an egress in one of these countries.
prefer_geo: Vec<CountryCode>Prefer an egress in one of these countries — fall back to the
default if the pool has no match. Soft counterpart to [geo].
ip_type: Option<EgressKind>Require an egress of this network kind.
session: Option<String>Name of an operator-supplied session (see --sessions) whose
headers (cookies / auth tokens) this site’s probes must carry.
The site is unreachable without it, so a missing session yields
Uncertain(SessionRequired) rather than a login-wall false
NotFound.
Implementations§
Source§impl AccessPolicy
impl AccessPolicy
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
True when the policy imposes no constraint at all (the common
case). Drives skip_serializing_if so existing sites.json
entries serialise unchanged.
Trait Implementations§
Source§impl Clone for AccessPolicy
impl Clone for AccessPolicy
Source§fn clone(&self) -> AccessPolicy
fn clone(&self) -> AccessPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AccessPolicy
impl Debug for AccessPolicy
Source§impl Default for AccessPolicy
impl Default for AccessPolicy
Source§fn default() -> AccessPolicy
fn default() -> AccessPolicy
Source§impl<'de> Deserialize<'de> for AccessPolicy
impl<'de> Deserialize<'de> for AccessPolicy
Source§fn 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>,
impl Eq for AccessPolicy
Source§impl PartialEq for AccessPolicy
impl PartialEq for AccessPolicy
Source§fn eq(&self, other: &AccessPolicy) -> bool
fn eq(&self, other: &AccessPolicy) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AccessPolicy
impl Serialize for AccessPolicy
impl StructuralPartialEq for AccessPolicy
Auto Trait Implementations§
impl Freeze for AccessPolicy
impl RefUnwindSafe for AccessPolicy
impl Send for AccessPolicy
impl Sync for AccessPolicy
impl Unpin for AccessPolicy
impl UnsafeUnpin for AccessPolicy
impl UnwindSafe for AccessPolicy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.