pub struct Checks { /* private fields */ }Expand description
Which checks run and how much each contributes to the score.
A disabled check is not computed at all.
Implementations§
Source§impl Checks
impl Checks
Sourcepub const fn none() -> Self
pub const fn none() -> Self
No checks: only token rotation and reuse detection protect the session.
Sourcepub fn strict() -> Self
pub fn strict() -> Self
Default weights with network and environment signals raised, for sensitive routes: IP prefix, ASN, language, TLS, ping-pong, an orphaned token and entering an anonymizer weigh 40 (step-up on their own) and a country change or entering Tor or an open proxy weighs 80 (revoke).
Sourcepub const fn enable(self, check: Check) -> Self
pub const fn enable(self, check: Check) -> Self
Turns check on at its default weight (keeps a custom weight if already enabled).
Sourcepub const fn weight(self, check: Check, weight: u32) -> Self
pub const fn weight(self, check: Check, weight: u32) -> Self
Enables check with a custom weight.
Sourcepub const fn is_enabled(&self, check: Check) -> bool
pub const fn is_enabled(&self, check: Check) -> bool
Whether check runs.
Trait Implementations§
impl Copy for Checks
impl Eq for Checks
impl StructuralPartialEq for Checks
Auto Trait Implementations§
impl Freeze for Checks
impl RefUnwindSafe for Checks
impl Send for Checks
impl Sync for Checks
impl Unpin for Checks
impl UnsafeUnpin for Checks
impl UnwindSafe for Checks
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more