pub enum TrustTier {
Preferred,
Acceptable,
Marginal,
Blocked,
}Expand description
Declared effectiveness of a proxy against a given anti-bot vendor.
Preferred is the highest trust, Blocked means the proxy is
known to be defeated by the vendor (used as the default for free-list
fetches so callers cannot accidentally route premium traffic through
a public free-list pool).
§Example
use stygian_proxy::types::TrustTier;
assert!(TrustTier::Preferred.rank() > TrustTier::Acceptable.rank());
assert!(TrustTier::Acceptable.rank() > TrustTier::Marginal.rank());
assert!(TrustTier::Marginal.rank() > TrustTier::Blocked.rank());Variants§
Preferred
The proxy is known to defeat the vendor on the first try.
Acceptable
The proxy typically succeeds; expect occasional friction.
Marginal
The proxy is hit-or-miss; budget for retries and CAPTCHA solves.
Blocked
The proxy is known to be blocked. Used as the default for free-list fetches so operators must opt-in to using them for premium vendors.
Implementations§
Source§impl TrustTier
impl TrustTier
Sourcepub const fn rank(self) -> u8
pub const fn rank(self) -> u8
Rank used for tier-comparison helpers.
Higher = better. Preferred (4) > Acceptable (3) > Marginal (2) >
Blocked (1). The value is 1-based so Blocked is still
“ranked” (i.e. not zero) — that lets is_blocked() be a simple
rank() == 1 check.
§Example
use stygian_proxy::types::TrustTier;
assert!(TrustTier::Preferred.is_blocked() == false);
assert!(TrustTier::Blocked.is_blocked());Sourcepub const fn is_blocked(self) -> bool
pub const fn is_blocked(self) -> bool
true when the tier is TrustTier::Blocked.
§Example
use stygian_proxy::types::TrustTier;
assert!(TrustTier::Blocked.is_blocked());
assert!(!TrustTier::Marginal.is_blocked());Trait Implementations§
impl Copy for TrustTier
Source§impl<'de> Deserialize<'de> for TrustTier
impl<'de> Deserialize<'de> for TrustTier
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 TrustTier
Source§impl Ord for TrustTier
impl Ord for TrustTier
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for TrustTier
impl PartialOrd for TrustTier
impl StructuralPartialEq for TrustTier
Auto Trait Implementations§
impl Freeze for TrustTier
impl RefUnwindSafe for TrustTier
impl Send for TrustTier
impl Sync for TrustTier
impl Unpin for TrustTier
impl UnsafeUnpin for TrustTier
impl UnwindSafe for TrustTier
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.