iso7816_tlv/
lib.rs

1//! This crate provides tools and utilities for handling TLV data as
2//! defined in [ISO7816-4][iso7816-4].
3//!
4//! This include BER-TLV data or SIMPLE-TLV data objects.
5//!
6//!
7//!
8//!
9//! [iso7816-4]: https://www.iso.org/standard/54550.html
10
11#![deny(missing_docs)]
12#![cfg_attr(feature = "cargo-clippy", deny(clippy::all))]
13#![cfg_attr(feature = "cargo-clippy", deny(clippy::pedantic))]
14// otherwise cargo doc fails with
15// error: no global memory allocator found but one is required; link to std or add #[global_allocator] to
16// a static item that implements the GlobalAlloc trait.
17#![cfg_attr(not(doc), no_std)]
18
19// use custom allocator for tests
20#[cfg(test)]
21use static_alloc::Bump;
22#[cfg(test)]
23#[global_allocator]
24static ALLOC: Bump<[u8; 1 << 28]> = Bump::uninit();
25
26// use vectors
27#[macro_use]
28extern crate alloc;
29
30#[cfg(test)]
31#[macro_use]
32extern crate hex_literal;
33
34use core::result;
35
36// internal organization
37pub mod ber;
38mod error;
39pub mod simple;
40
41// custom reexport (structs at same level for users)
42pub use error::TlvError;
43
44type Result<T> = result::Result<T, TlvError>;