pub struct RegisteredClient<'a> { /* private fields */ }Expand description
Recombines an EncodedClient and a PasswordPolicy to check authentication.
Implementations§
Source§impl<'a> RegisteredClient<'a>
impl<'a> RegisteredClient<'a>
Sourcepub fn new(client: &'a EncodedClient, policy: &'a dyn PasswordPolicy) -> Self
pub fn new(client: &'a EncodedClient, policy: &'a dyn PasswordPolicy) -> Self
Binds a client and a policy reference together.
The policy should be the same or equivalent to the policy used to create the encoded client data, as otherwise authentication will obviously not work.
Sourcepub fn check_authentication(
&self,
passphrase: Option<&[u8]>,
) -> Result<(), RegistrarError>
pub fn check_authentication( &self, passphrase: Option<&[u8]>, ) -> Result<(), RegistrarError>
Try to authenticate with the client and passphrase. This check will success if either the client is public and no passphrase was provided or if the client is confidential and the passphrase matches.
Auto Trait Implementations§
impl<'a> Freeze for RegisteredClient<'a>
impl<'a> !RefUnwindSafe for RegisteredClient<'a>
impl<'a> Send for RegisteredClient<'a>
impl<'a> Sync for RegisteredClient<'a>
impl<'a> Unpin for RegisteredClient<'a>
impl<'a> !UnwindSafe for RegisteredClient<'a>
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