pub struct DefenseState { /* private fields */ }Expand description
Bounded, deterministic observation of a response’s defensive posture.
Implementations§
Source§impl DefenseState
impl DefenseState
Sourcepub fn observe(status: u16, headers: &[(&str, &str)], body: &str) -> Self
pub fn observe(status: u16, headers: &[(&str, &str)], body: &str) -> Self
Observes the defensive posture of one response.
headers is a transport-neutral (name, value) list matched
case-insensitively. body is scanned only up to the fingerprint scan
ceiling, so a large body cannot turn one observation into unbounded work.
Sourcepub const fn status_signal(&self) -> DefenseStatusSignal
pub const fn status_signal(&self) -> DefenseStatusSignal
Returns the coarse status classification.
Sourcepub const fn is_challenged(&self) -> bool
pub const fn is_challenged(&self) -> bool
Returns whether the body carried an interstitial challenge or block marker.
Sourcepub const fn is_rate_limited(&self) -> bool
pub const fn is_rate_limited(&self) -> bool
Returns whether the response is rate limited by status or headers.
Sourcepub const fn has_rate_limit_headers(&self) -> bool
pub const fn has_rate_limit_headers(&self) -> bool
Returns whether rate-limit accounting headers were present.
Sourcepub const fn fingerprint(&self) -> Option<&DefenseFingerprint>
pub const fn fingerprint(&self) -> Option<&DefenseFingerprint>
Returns the product fingerprint observed for this response, if any.
Sourcepub const fn posture(&self) -> DefensePosture
pub const fn posture(&self) -> DefensePosture
Returns the overall inferred defensive posture.
Trait Implementations§
Source§impl Clone for DefenseState
impl Clone for DefenseState
Source§fn clone(&self) -> DefenseState
fn clone(&self) -> DefenseState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefenseState
impl Debug for DefenseState
impl Eq for DefenseState
Source§impl PartialEq for DefenseState
impl PartialEq for DefenseState
impl StructuralPartialEq for DefenseState
Auto Trait Implementations§
impl Freeze for DefenseState
impl RefUnwindSafe for DefenseState
impl Send for DefenseState
impl Sync for DefenseState
impl Unpin for DefenseState
impl UnsafeUnpin for DefenseState
impl UnwindSafe for DefenseState
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§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.§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