Struct nitrokey::Pro[][src]

pub struct Pro<'a> { /* fields omitted */ }

A Nitrokey Pro device without user or admin authentication.

Use the connect method to obtain an instance wrapper or the connect_pro method to directly obtain an instance. If you want to execute a command that requires user or admin authentication, use authenticate_admin or authenticate_user.

Examples

Authentication with error handling:

use nitrokey::{Authenticate, User, Pro};

fn perform_user_task<'a>(device: &User<'a, Pro<'a>>) {}
fn perform_other_task(device: &Pro) {}

let mut manager = nitrokey::take()?;
let device = manager.connect_pro()?;
let device = match device.authenticate_user("123456") {
    Ok(user) => {
        perform_user_task(&user);
        user.device()
    },
    Err((device, err)) => {
        eprintln!("Could not authenticate as user: {}", err);
        device
    },
};
perform_other_task(&device);

Trait Implementations

impl<'a> Authenticate<'a> for Pro<'a>[src]

impl<'a> Debug for Pro<'a>[src]

impl<'a> Device<'a> for Pro<'a>[src]

impl<'a> Drop for Pro<'a>[src]

impl<'a> From<Pro<'a>> for DeviceWrapper<'a>[src]

impl<'a> GenerateOtp for Pro<'a>[src]

impl<'a> GetPasswordSafe<'a> for Pro<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Pro<'a>

impl<'a> Send for Pro<'a>

impl<'a> Sync for Pro<'a>

impl<'a> Unpin for Pro<'a>

impl<'a> !UnwindSafe for Pro<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.