minicbor_adapters/lib.rs
1//! Adapters between [`minicbor`] and other crates
2//!
3//! Some pairs of types don't have a clear place to implement with minicbor: Due to the orphan
4//! rule, an implementation of minicbor's traits for a type needs to be implemented either in minicbor
5//! itself or in the crate providing the type. As minicbor tries to keep its (even optional)
6//! dependency count at a minimum, and other crates are more general-purpose than minicbor, this
7//! crate provides thin wrapper types that provide the implementations.
8//!
9//! ## Versioning
10//!
11//! This crate has both minicbor and the related types as public dependencies. It will thus undergo
12//! a breaking change when any of those crates has a breaking release, possibly multiple at the
13//! same time.
14//!
15//! Providing implementations for a larger matrix is generally feasilbe by depending on multiple
16//! versions of crates, and is sometimes maintainable when the breaking changes don't affect the
17//! implementation (as was often the case with minicbor < 1.0); nonetheless, this is currently not
18//! done for reasons of simplicity.
19#![no_std]
20
21mod cboritem;
22mod embedded_io;
23mod heapless;
24pub mod with;
25
26pub use cboritem::WithOpaque;
27pub use embedded_io::WriteToEmbeddedIo;
28pub use heapless::writers::WriteToHeapless;
29pub use with::{cbor_len, decode, encode};