[−][src]Function nitrokey::connect
pub fn connect() -> Result<DeviceWrapper, CommandError>
Connects to a Nitrokey device. This method can be used to connect to any connected device, both a Nitrokey Pro and a Nitrokey Storage.
Errors
Undefined
if no Nitrokey device is connected
Example
use nitrokey::DeviceWrapper; fn do_something(device: DeviceWrapper) {} match nitrokey::connect() { Ok(device) => do_something(device), Err(err) => println!("Could not connect to a Nitrokey: {}", err), }