diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-12-28 23:34:58 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2020-01-07 11:33:14 +0100 |
commit | 6b439950c3c856f1b0eb6df2c9e89387b1697608 (patch) | |
tree | 10fecbab6af91be1e513bc6268bb29fb29e65441 /src/lib.rs | |
parent | ddb175bd963070e837aa9207c2dee32ffffc51f4 (diff) | |
download | nitrokey-rs-6b439950c3c856f1b0eb6df2c9e89387b1697608.tar.gz nitrokey-rs-6b439950c3c856f1b0eb6df2c9e89387b1697608.tar.bz2 |
Implement conversion traits for Model and NK_device_model
A nitrokey_sys::NK_device_model (= u32) value may correspond to a
nitrokey::Model, and vice versa. This patch adds the appropriate From
and TryFrom implementations.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -235,6 +235,7 @@ impl Manager { /// # Errors /// /// - [`NotConnected`][] if no Nitrokey device is connected + /// - [`UnsupportedModelError`][] if the Nitrokey device is not supported by this crate /// /// # Example /// @@ -252,6 +253,7 @@ impl Manager { /// ``` /// /// [`NotConnected`]: enum.CommunicationError.html#variant.NotConnected + /// [`UnsupportedModelError`]: enum.Error.html#variant.UnsupportedModelError pub fn connect(&mut self) -> Result<DeviceWrapper<'_>, Error> { if unsafe { nitrokey_sys::NK_login_auto() } == 1 { device::get_connected_device(self) |