pub struct LengthRule { /* private fields */ }Expand description
Rule for determining if a password is within a desired length. The minimum and maximum lengths are used inclusively to determine if a password meets this rule.
§Example
use passay_rs::rule::PasswordData;
use passay_rs::rule::length::LengthRule;
use passay_rs::rule::Rule;
let rule = LengthRule::new(4, 10);
let password = PasswordData::with_password("123".to_string());
let result = rule.validate(&password);
assert!(!result.valid());Implementations§
Source§impl LengthRule
impl LengthRule
Trait Implementations§
Source§impl Default for LengthRule
impl Default for LengthRule
Source§impl Rule for LengthRule
impl Rule for LengthRule
fn validate(&self, password_data: &PasswordData) -> RuleResult
fn as_has_characters(&self) -> Option<&dyn HasCharacters>
fn as_dictionary_rule(&self) -> Option<&dyn DictionaryRuleTrait>
Auto Trait Implementations§
impl Freeze for LengthRule
impl RefUnwindSafe for LengthRule
impl Send for LengthRule
impl Sync for LengthRule
impl Unpin for LengthRule
impl UnsafeUnpin for LengthRule
impl UnwindSafe for LengthRule
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