pub struct Checker<Type> {
pub name: &'static str,
pub description: &'static str,
pub link: &'static str,
pub tags: Vec<&'static str>,
pub expected_runtime: f32,
pub popularity: f32,
pub lemmeknow_config: Identifier,
pub sensitivity: Sensitivity,
pub enhanced_detector: Option<()>,
pub _phantom: PhantomData<Type>,
}
Expand description
Every checker is of type CheckerType This will let us pick & choose which checkers to use at runtime.
Fields§
§name: &'static str
The name of the checker
description: &'static str
The description of the checker you can take the first line from Wikipedia Sometimes our checkers do not exist on Wikipedia so we write our own.
link: &'static str
The link to the checker’s website Wikipedia link, articles, github etc
The tags of the checker
expected_runtime: f32
The expected runtime of the checker We get this by bench marking the code
popularity: f32
The popularity of the checker
lemmeknow_config: Identifier
lemmeknow config object
sensitivity: Sensitivity
The sensitivity level for gibberish detection This is only used by checkers that implement the SensitivityAware trait
enhanced_detector: Option<()>
Enhanced gibberish detector using BERT model This is only used when enhanced detection is enabled
_phantom: PhantomData<Type>
https://doc.rust-lang.org/std/marker/struct.PhantomData.html
Let’s us save memory by telling the compiler that our type
acts like a type
Trait Implementations§
Source§impl Check for Checker<Athena>
impl Check for Checker<Athena>
Source§fn check(&self, text: &str) -> CheckResult
fn check(&self, text: &str) -> CheckResult
Source§fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
Source§fn get_sensitivity(&self) -> Sensitivity
fn get_sensitivity(&self) -> Sensitivity
Source§impl Check for Checker<DefaultChecker>
impl Check for Checker<DefaultChecker>
Source§fn check(&self, _text: &str) -> CheckResult
fn check(&self, _text: &str) -> CheckResult
Source§fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
Source§fn get_sensitivity(&self) -> Sensitivity
fn get_sensitivity(&self) -> Sensitivity
Source§impl Check for Checker<EnglishChecker>
given an input, check every item in the array and return true if any of them match
impl Check for Checker<EnglishChecker>
given an input, check every item in the array and return true if any of them match
Source§fn check(&self, text: &str) -> CheckResult
fn check(&self, text: &str) -> CheckResult
Source§fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
Source§fn get_sensitivity(&self) -> Sensitivity
fn get_sensitivity(&self) -> Sensitivity
Source§impl Check for Checker<LemmeKnow>
impl Check for Checker<LemmeKnow>
Source§fn check(&self, text: &str) -> CheckResult
fn check(&self, text: &str) -> CheckResult
Source§fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
Source§fn get_sensitivity(&self) -> Sensitivity
fn get_sensitivity(&self) -> Sensitivity
Source§impl Check for Checker<PasswordChecker>
Implementation of the Check trait for PasswordChecker
impl Check for Checker<PasswordChecker>
Implementation of the Check trait for PasswordChecker
Source§fn check(&self, text: &str) -> CheckResult
fn check(&self, text: &str) -> CheckResult
Source§fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
Source§fn get_sensitivity(&self) -> Sensitivity
fn get_sensitivity(&self) -> Sensitivity
Source§impl Check for Checker<RegexChecker>
impl Check for Checker<RegexChecker>
Source§fn check(&self, text: &str) -> CheckResult
fn check(&self, text: &str) -> CheckResult
Source§fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
Source§fn get_sensitivity(&self) -> Sensitivity
fn get_sensitivity(&self) -> Sensitivity
Source§impl Check for Checker<WaitAthena>
impl Check for Checker<WaitAthena>
Source§fn check(&self, text: &str) -> CheckResult
fn check(&self, text: &str) -> CheckResult
Source§fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
Source§fn get_sensitivity(&self) -> Sensitivity
fn get_sensitivity(&self) -> Sensitivity
Source§impl Check for Checker<WordlistChecker>
impl Check for Checker<WordlistChecker>
Source§fn check(&self, text: &str) -> CheckResult
fn check(&self, text: &str) -> CheckResult
Source§fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
fn with_sensitivity(self, sensitivity: Sensitivity) -> Self
Source§fn get_sensitivity(&self) -> Sensitivity
fn get_sensitivity(&self) -> Sensitivity
Auto Trait Implementations§
impl<Type> Freeze for Checker<Type>
impl<Type> RefUnwindSafe for Checker<Type>where
Type: RefUnwindSafe,
impl<Type> Send for Checker<Type>where
Type: Send,
impl<Type> Sync for Checker<Type>where
Type: Sync,
impl<Type> Unpin for Checker<Type>where
Type: Unpin,
impl<Type> UnwindSafe for Checker<Type>where
Type: UnwindSafe,
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> 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> ⓘ
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> ⓘ
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