pub struct Authenticator { /* private fields */ }
Implementations§
Source§impl Authenticator
impl Authenticator
pub fn new<T: Into<Vec<u8>>, L: Into<u8>>(secret: T, digits: L) -> Authenticator
pub fn from_base32<T: Into<String>, L: Into<u8>>( encoded_secret: T, digits: L, ) -> Result<Authenticator, Error>
pub fn from_token_url<T: Into<String>>(token: T) -> Result<Authenticator, Error>
pub fn generate_totp(&self) -> u32
pub fn generate_hotp(&self, counter: u64) -> u32
Trait Implementations§
Source§impl Clone for Authenticator
impl Clone for Authenticator
Source§fn clone(&self) -> Authenticator
fn clone(&self) -> Authenticator
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for Authenticator
impl RefUnwindSafe for Authenticator
impl Send for Authenticator
impl Sync for Authenticator
impl Unpin for Authenticator
impl UnwindSafe for Authenticator
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