ctap2-proto: Derive serde types for UsizeN

Just a wrapper struct around bounded_integer::BoundedUsize the
bounded_integer/serde1 feature needs to be enabled.
main
Nick Zana 2 years ago
parent 3f61a17784
commit 542a3b9b77

@ -12,4 +12,4 @@ coset = "0.3.3"
serde = { version = "1.0", features = ["derive"], optional = true }
[features]
serde = ["dep:serde", "fido-common/serde"]
serde = ["dep:serde", "fido-common/serde", "bounded-integer/serde1"]

@ -7,8 +7,12 @@ use std::collections::{BTreeMap, BTreeSet};
use std::num::NonZeroUsize;
use std::usize;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
/// A usize with a minimum value of N
#[derive(Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct UsizeN<const N: usize>(bounded_integer::BoundedUsize<N, { usize::MAX }>);
/// > data type byte string and identifying the authenticator model, i.e.

Loading…
Cancel
Save