pub struct ValidatorChain { /* private fields */ }Expand description
A chain of validators that tries each one in order
Implementations§
Source§impl ValidatorChain
impl ValidatorChain
Sourcepub fn add<V: TokenValidator + 'static>(&mut self, validator: V)
pub fn add<V: TokenValidator + 'static>(&mut self, validator: V)
Add a validator to the chain
Sourcepub fn with<V: TokenValidator + 'static>(self, validator: V) -> Self
pub fn with<V: TokenValidator + 'static>(self, validator: V) -> Self
Add a validator and return self for chaining
Sourcepub fn validate(&self, token: &str) -> ValidationResult
pub fn validate(&self, token: &str) -> ValidationResult
Validate a token using all validators in order
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ValidatorChain
impl !RefUnwindSafe for ValidatorChain
impl Send for ValidatorChain
impl Sync for ValidatorChain
impl Unpin for ValidatorChain
impl !UnwindSafe for ValidatorChain
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