ctaphid_types/
lib.rs

1// Copyright (C) 2021 Robin Krahl <robin.krahl@ireas.org>
2// SPDX-License-Identifier: Apache-2.0 or MIT
3
4//! Data types for the CTAPHID protocol.
5//!
6//! See [ยง 11.2 of the CTAP specification][spec] for more information.
7//!
8//! [spec]: https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#usb-channels
9
10#![warn(
11    missing_copy_implementations,
12    missing_debug_implementations,
13    missing_docs,
14    non_ascii_idents,
15    trivial_casts,
16    unused,
17    unused_qualifications,
18    clippy::expect_used,
19    clippy::unwrap_used
20)]
21#![deny(unsafe_code)]
22#![cfg_attr(not(feature = "std"), no_std)]
23
24mod channel;
25mod command;
26mod error;
27mod message;
28mod packet;
29mod response;
30mod transaction;
31mod util;
32
33pub use channel::Channel;
34pub use command::{Command, VendorCommand};
35pub use error::{
36    DefragmentationError, DeviceError, FragmentationError, ParseError, SerializationError,
37};
38pub use message::{DefragmentedMessage, Fragments, Message, PartialMessage};
39pub use packet::{ContinuationPacket, InitializationPacket, Packet, PacketType};
40pub use response::{Capabilities, DeviceVersion, InitResponse};
41pub use transaction::Transaction;
42
43/// The CTAPHID protocol version implemented by this crate.
44pub const PROTOCOL_VERSION: u8 = 2;