pub struct ChallengeType(/* private fields */);Expand description
Type-safe wrapper for WebAuthn challenge types.
This provides compile-time safety to prevent mixing up challenge types with other string types. Challenge types identify the kind of WebAuthn operation (registration, authentication) and are used as cache prefixes for storing challenge data.
Implementations§
Source§impl ChallengeType
impl ChallengeType
Sourcepub fn new(challenge_type: String) -> Result<Self, PasskeyError>
pub fn new(challenge_type: String) -> Result<Self, PasskeyError>
Creates a new ChallengeType from a string with validation.
This constructor validates the challenge type to ensure it meets requirements for cache operations and WebAuthn flow identification.
§Arguments
challenge_type- The challenge type string
§Returns
Ok(ChallengeType)- If the challenge type is validErr(PasskeyError)- If the challenge type is invalid
§Validation Rules
- Must not be empty
- Must contain only alphanumeric characters and underscores
- Must be reasonable length
Sourcepub fn registration() -> Self
pub fn registration() -> Self
Sourcepub fn authentication() -> Self
pub fn authentication() -> Self
Trait Implementations§
Source§impl Clone for ChallengeType
impl Clone for ChallengeType
Source§fn clone(&self) -> ChallengeType
fn clone(&self) -> ChallengeType
Returns a duplicate of the value. Read more
1.0.0 · 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 ChallengeType
impl Debug for ChallengeType
Source§impl PartialEq for ChallengeType
impl PartialEq for ChallengeType
impl StructuralPartialEq for ChallengeType
Auto Trait Implementations§
impl Freeze for ChallengeType
impl RefUnwindSafe for ChallengeType
impl Send for ChallengeType
impl Sync for ChallengeType
impl Unpin for ChallengeType
impl UnwindSafe for ChallengeType
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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