1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//! A set of I/O utilities for working with CBOR encoded values.

#![forbid(unsafe_code)]

mod error;
mod reader;
mod writer;

#[cfg(feature = "async-io")]
mod async_reader;

#[cfg(feature = "async-io")]
mod async_writer;

pub use error::Error;
pub use reader::Reader;
pub use writer::Writer;

#[cfg(feature = "async-io")]
pub use async_reader::AsyncReader;

#[cfg(feature = "async-io")]
pub use async_writer::AsyncWriter;

/// Ensure we can safely cast a `u32` to a `usize`.
const __U32_FITS_INTO_USIZE: () =
    if std::mem::size_of::<u32>() > std::mem::size_of::<usize>() {
        panic!("This crate requires at least a 32-bit architecture.")
    };