pub struct Device<H: HidDevice> { /* private fields */ }
Expand description
A connected Nitrokey 3 device.
Implementations
sourceimpl<H: HidDevice> Device<H>
impl<H: HidDevice> Device<H>
sourcepub fn new(device: Device<H>) -> Self
pub fn new(device: Device<H>) -> Self
Creates a new Nitrokey 3 instance from the given ctaphid::Device
, assuming that it is
a Nitrokey 3 device.
Use list
to get a list of all available Nitrokey 3 devices and
DeviceInfo::connect
to connect to one of them.
sourcepub fn firmware_version(&self) -> Result<Version, Error>
pub fn firmware_version(&self) -> Result<Version, Error>
Queries the firmware version of the device.
sourcepub fn uuid(&self) -> Result<Uuid, Error>
pub fn uuid(&self) -> Result<Uuid, Error>
Queries the UUID of the device.
This command requires the firmware version v1.0.1.
Trait Implementations
Auto Trait Implementations
impl<H> !RefUnwindSafe for Device<H>
impl<H> Send for Device<H> where
H: Send,
<H as Device>::Info: Send,
impl<H> !Sync for Device<H>
impl<H> Unpin for Device<H> where
H: Unpin,
<H as Device>::Info: Unpin,
impl<H> UnwindSafe for Device<H> where
H: UnwindSafe,
<H as Device>::Info: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more