ctap2: Set repr(u8) for Error and implement From<Error> for u8

Fixes: https://github.com/trussed-dev/ctap-types/issues/63
This commit is contained in:
Robin Krahl
2026-06-08 10:10:59 +02:00
parent f8a76d3e84
commit 90d2509941
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Remove unused `Rpc` trait.
- Remove `cbor-smol` re-export as `serde`.
- Make `ctap2::CtapMappingError` private.
- Set `#[repr(u8)]` for `ctap2::Error` and implement `From<ctap2::Error>` for `u8`.
## [0.6.0-rc.4] 2026-06-01
+7
View File
@@ -444,6 +444,7 @@ impl<'de> Deserialize<'de> for AttestationFormatsPreference {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[non_exhaustive]
#[repr(u8)]
pub enum Error {
Success = 0x00,
InvalidCommand = 0x01,
@@ -502,6 +503,12 @@ pub enum Error {
VendorLast = 0xFF,
}
impl From<Error> for u8 {
fn from(error: Error) -> u8 {
error as _
}
}
/// CTAP2 authenticator API
pub trait Authenticator {
fn get_info(&mut self) -> get_info::Response;