diff options
Diffstat (limited to 'src/device.rs')
-rw-r--r-- | src/device.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/device.rs b/src/device.rs index 4f96860..843b41d 100644 --- a/src/device.rs +++ b/src/device.rs @@ -50,6 +50,26 @@ enum Model { /// # } /// ``` /// +/// Device-specific commands: +/// +/// ```no_run +/// use nitrokey::{DeviceWrapper, Storage}; +/// # use nitrokey::CommandError; +/// +/// fn perform_common_task(device: &DeviceWrapper) {} +/// fn perform_storage_task(device: &Storage) {} +/// +/// # fn try_main() -> Result<(), CommandError> { +/// let device = nitrokey::connect()?; +/// perform_common_task(&device); +/// match device { +/// DeviceWrapper::Storage(storage) => perform_storage_task(&storage), +/// _ => (), +/// }; +/// # Ok(()) +/// # } +/// ``` +/// /// [`connect`]: fn.connect.html // TODO: add example for Storage-specific code #[derive(Debug)] |