pub struct OTP { /* private fields */ }
Implementations§
Source§impl OTP
impl OTP
pub fn new(secret: &str, digits: Option<u32>, period: Option<u32>) -> Self
pub async fn hotp(&self, counter: u64) -> Result<String, Error>
pub async fn totp(&self) -> Result<String, Error>
pub async fn verify( &self, otp: &str, window: Option<i32>, ) -> Result<bool, Error>
pub fn url(&self, issuer: &str, account: &str) -> Result<String, Error>
Auto Trait Implementations§
impl Freeze for OTP
impl RefUnwindSafe for OTP
impl Send for OTP
impl Sync for OTP
impl Unpin for OTP
impl UnwindSafe for OTP
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