aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/device/mod.rs1
-rw-r--r--src/device/wrapper.rs1
-rw-r--r--src/error.rs4
3 files changed, 6 insertions, 0 deletions
diff --git a/src/device/mod.rs b/src/device/mod.rs
index c84faa1..e9018a4 100644
--- a/src/device/mod.rs
+++ b/src/device/mod.rs
@@ -28,6 +28,7 @@ pub use wrapper::DeviceWrapper;
/// Available Nitrokey models.
#[derive(Clone, Copy, Debug, PartialEq)]
+#[non_exhaustive]
pub enum Model {
/// The Nitrokey Storage.
Storage,
diff --git a/src/device/wrapper.rs b/src/device/wrapper.rs
index 69291ad..942a905 100644
--- a/src/device/wrapper.rs
+++ b/src/device/wrapper.rs
@@ -64,6 +64,7 @@ use crate::otp::GenerateOtp;
///
/// [`connect`]: struct.Manager.html#method.connect
#[derive(Debug)]
+#[non_exhaustive]
pub enum DeviceWrapper<'a> {
/// A Nitrokey Storage device.
Storage(Storage<'a>),
diff --git a/src/error.rs b/src/error.rs
index 64a2ce0..f1e91c3 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -11,6 +11,7 @@ use crate::device;
/// An error returned by the nitrokey crate.
#[derive(Debug)]
+#[non_exhaustive]
pub enum Error {
/// An error reported by the Nitrokey device in the response packet.
CommandError(CommandError),
@@ -111,6 +112,7 @@ impl fmt::Display for Error {
/// An error reported by the Nitrokey device in the response packet.
#[derive(Clone, Copy, Debug, PartialEq)]
+#[non_exhaustive]
pub enum CommandError {
/// A packet with a wrong checksum has been sent or received.
WrongCrc,
@@ -177,6 +179,7 @@ impl fmt::Display for CommandError {
/// A device communication error.
#[derive(Clone, Copy, Debug, PartialEq)]
+#[non_exhaustive]
pub enum CommunicationError {
/// Could not connect to a Nitrokey device.
NotConnected,
@@ -215,6 +218,7 @@ impl fmt::Display for CommunicationError {
/// A library usage error.
#[derive(Clone, Copy, Debug, PartialEq)]
+#[non_exhaustive]
pub enum LibraryError {
/// A supplied string exceeded a length limit.
StringTooLong,