minicbor_io/
lib.rs

1//! A set of I/O utilities for working with CBOR encoded values.
2
3#![forbid(unsafe_code)]
4
5mod error;
6mod reader;
7mod writer;
8
9#[cfg(feature = "async-io")]
10mod async_reader;
11
12#[cfg(feature = "async-io")]
13mod async_writer;
14
15pub use error::Error;
16pub use reader::Reader;
17pub use writer::Writer;
18
19#[cfg(feature = "async-io")]
20pub use async_reader::AsyncReader;
21
22#[cfg(feature = "async-io")]
23pub use async_writer::AsyncWriter;
24
25/// Ensure we can safely cast a `u32` to a `usize`.
26const __U32_FITS_INTO_USIZE: () =
27    if std::mem::size_of::<u32>() > std::mem::size_of::<usize>() {
28        panic!("This crate requires at least a 32-bit architecture.")
29    };
30