Struct distant_net::common::authentication::Verifier
source · pub struct Verifier { /* private fields */ }Expand description
Supports authenticating using a variety of methods
Implementations
sourceimpl Verifier
impl Verifier
pub fn new<I>(methods: I) -> Selfwhere
I: IntoIterator<Item = Box<dyn AuthenticationMethod>>,
sourcepub fn none() -> Self
pub fn none() -> Self
Creates a verifier that uses the NoneAuthenticationMethod exclusively.
sourcepub fn static_key(key: impl Into<HeapSecretKey>) -> Self
pub fn static_key(key: impl Into<HeapSecretKey>) -> Self
Creates a verifier that uses the StaticKeyAuthenticationMethod exclusively.
sourcepub fn methods(&self) -> impl Iterator<Item = &'static str> + '_
pub fn methods(&self) -> impl Iterator<Item = &'static str> + '_
Returns an iterator over the ids of the methods supported by the verifier
sourcepub async fn verify(
&self,
authenticator: &mut dyn Authenticator
) -> Result<&'static str>
pub async fn verify(
&self,
authenticator: &mut dyn Authenticator
) -> Result<&'static str>
Attempts to verify by submitting challenges using the authenticator provided. Returns the
id of the authentication method that succeeded. Fails if no authentication method succeeds.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Verifier
impl Send for Verifier
impl Sync for Verifier
impl Unpin for Verifier
impl !UnwindSafe for Verifier
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more