pub enum VerificationResult {
Ok,
Unauthorized,
}Expand description
Result of a credential or secret verification step.
Use this enum when verification has two logical outcomes:
- the supplied secret is valid
- the supplied secret is not authorized
Infrastructure failures such as storage outages or backend errors should be
reported separately in your surrounding Result type.
§Conversions
VerificationResult::from(true)returnsVerificationResult::OkVerificationResult::from(false)returnsVerificationResult::Unauthorizedbool::from(VerificationResult::Ok)returnstruebool::from(VerificationResult::Unauthorized)returnsfalse
§Example
use webgates_core::verification_result::VerificationResult;
let result = VerificationResult::from(true);
assert_eq!(result, VerificationResult::Ok);
assert!(bool::from(result));Variants§
Trait Implementations§
Source§impl Clone for VerificationResult
impl Clone for VerificationResult
Source§fn clone(&self) -> VerificationResult
fn clone(&self) -> VerificationResult
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 VerificationResult
impl Debug for VerificationResult
Source§impl From<VerificationResult> for bool
impl From<VerificationResult> for bool
Source§fn from(result: VerificationResult) -> Self
fn from(result: VerificationResult) -> Self
Converts to this type from the input type.
Source§impl From<bool> for VerificationResult
impl From<bool> for VerificationResult
Source§impl PartialEq for VerificationResult
impl PartialEq for VerificationResult
Source§fn eq(&self, other: &VerificationResult) -> bool
fn eq(&self, other: &VerificationResult) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for VerificationResult
impl Eq for VerificationResult
impl StructuralPartialEq for VerificationResult
Auto Trait Implementations§
impl Freeze for VerificationResult
impl RefUnwindSafe for VerificationResult
impl Send for VerificationResult
impl Sync for VerificationResult
impl Unpin for VerificationResult
impl UnsafeUnpin for VerificationResult
impl UnwindSafe for VerificationResult
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