NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #2594 most downloaded on crates.io
A small CBOR codec suitable for no_std environments.
Last release 2 months ago
23 Jul 2026
Ships fairly regularly
a new release about every 4 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
71 releases · first in 2020
One column per quarter.
Adds support for u128/i128. See pull request [63][pr63] by @sdbondi for details.
u128/i128. See pull request [63][pr63] by @sdbondi for details.The std feature is no longer required for:
std feature is no longer required for:
IpAddr,Ipv4Addr,Ipv6Addr,SocketAddr,SocketAddrV4,SocketAddrV6.minicbor-derive-0.19.5.Fixes bugs related to CborLen calculation, see commit cb19b238e5245729932a9cf9611818be1dc20ab6 for details.
CborLen calculation, see commit cb19b238e5245729932a9cf9611818be1dc20ab6
for details.minicbor-derive-0.19.4.Depends on minicbor-derive-0.19.3.
minicbor-derive-0.19.3.Depends on minicbor-derive-0.19.0.
minicbor-derive-0.19.0.Depends on minicbor-derive-0.18.3.
minicbor-derive-0.18.3.Replaces build.rs with target_has_atomic. See pull request [47][pr47] by @dtolnay for details.
build.rs with target_has_atomic. See pull request [47][pr47] by @dtolnay for details.Depends on minicbor-derive-0.18.2.
minicbor-derive-0.18.2.Added Encoder::str_len, mirroring Encoder::bytes_len which was added in 0.26.1.
Encoder::str_len, mirroring Encoder::bytes_len which was added in 0.26.1.minicbor-derive-0.18.1.Depends on minicbor-derive-0.18.0 (see below).
Depends on minicbor-derive-0.18.0 (see below).
⚠️ Breaking ⚠️ Several generic implementations of Encode and Decode did not override
the default is_nil and nil methods. As a result, if a type T implements Encode and
Decode with implementations of is_nil and nil, wrapping the type in a Box or
Cell or encoding it via reference would revert to the default implementation. This
has been fixed and the following impls now override the defaults:
&T&mut TBox<T>Cow<'_, T>Cell<T>RefCell<T>With this fix, these types have a nil value if T has one whereas prior versions would not.
The Encode implementation of RefCell no longer uses try_borrow, but borrow.
Adds encode::Error::{as_write, into_write} to allow easier access to an error caused by a Write implementation.
encode::Error::{as_write, into_write} to allow easier access to an error caused by
a Write implementation.- Updated to 2024 edition.
Add encode::Cursor::set_position.
encode::write::Cursor::set_position.Implementations of Iterator::size_hint for decode::{ArrayIter, ArrayIterWithCtx}, decode::{MapIter, MapIterWithCtx} and decode::{BytesIter, StrIter}`
Iterator::size_hint for decode::{ArrayIter, ArrayIterWithCtx}, decode::{MapIter, MapIterWithCtx}anddecode::{BytesIter, StrIter}` (see pull request
[27][pr27] by @carloskiki for details).decode::{BytesIter, StrIter}, both of which would yield None for
definite but empty bytes or text. They now yield Some(&[]) or Some("") respectively.
Note that the behaviour for non-empty definite bytes or text values and for indefinite ones
does not change.EncodeBytes, DecodeBytes and CborLenBytes for Box<[u8]> (see pull request
[28][pr28] by @carloskiki for details).Depends on minicbor-derive-0.16.2.
minicbor-derive-0.16.2.Fixes issue with minicbor::display (see issue [25][i25]) for details.
minicbor::display (see issue [25][i25]) for details.minicbor-derive-0.16.1.The method Encoder::bytes_len has been added. Like Encoder::bytes, it writes the CBOR item head of a byte string. However, unlike Encoder::bytes, it d
Encoder::bytes_len has been added. Like Encoder::bytes, it writes the CBOR item
head of a byte string. However, unlike Encoder::bytes, it does not require the actual bytes as
a parameter, leaving their encoding to the application. This mirrors the approach of
Encoder::array and Encoder::map, which also encode only the CBOR item head, with applications
encoding the elements via subsequent encoder method calls. For further details, see pull request
[16][pr16] by @carloskiki.Encode and Decode impls for usize, isize, NonZeroUsize and NonZeroIsize on 16-bit
architectures have been added by @chrysn. See pull request [19][pr19] for details.Depends on minicbor-derive-0.16.0.
minicbor-derive-0.16.0.- Update documentation.
Error types now implement core::Error, which was stabilised in Rust 1.81.
core::error::Error, which was stabilised in Rust 1.81.Encode and Decode are implemented for core::num::{NonZeroIsize, NonZeroUsize} (see
merge request [48][mr48] by @chrysn).Maintenance release (documentation tweaks).
Maintenance release (cf. merge request [47][mr47] by @chrysn).
Maintenance release (cf. merge request [46][mr46] by @deundiak).
Maintenance release (cf. merge requests [44][mr44] by @alistair23 and [45][mr45] by @deundiak).
Added minicbor::Tagged, a newtype with a statically attached numeric tag.
minicbor::data::Tagged, a newtype with a statically attached numeric tag.skip and tag (see minicbor-derive-0.15.0 for details).minicbor-derive-0.15.0.Removed the deprecated Encoder::into_inner method. Use Encoder::into_writer instead.
Token from minicbor::decode to minicbor::data. Token also implements Decode now.Encoder::into_inner method. Use Encoder::into_writer instead.⚠️ Breaking ⚠️: Tokenizer now has two lifetime parameters because it sometimes borrows the inner Decoder.
Tokenizer now has two lifetime parameters because it sometimes borrows the
inner Decoder.Tokens can now also be encoded (cf. merge request [37][mr37] by @alistair23). Methods Encoder::tokens
and Decoder::tokens have been added.Tag::new and Tag::as_u64 are now declared const (cf. merge request [36][mr36] by @DCNick3).
Tag::new and Tag::as_u64 are now declared const (cf. merge request [36][mr36] by @DCNick3).⚠️ Breaking ⚠️: Tag handling has been reworked (cf. merge request [34][mr34]). The Tag type is now merely a newtype around a u64. A new enum IanaTag r
Tag type is now
merely a newtype around a u64. A new enum IanaTag represents registered tag values.Support for decoding arrays of arbitrary length has been added (cf. merge request [31][mr31] by @samuelmhicks).
Encode and Decode impls for CStr and CString (cf. merge request [29][mr29]).decode::info::Size to allow length introspection of CBOR values (see merge requests [25][mr25]
and [28][mr28] for details).Bugfix release (see merge request [26][mr26] by @jeandudey for details).
Added the trait CborLen and functions minicbor::len and minicbor::len_with to allow client code to calculate the length in bytes of a value's CBOR rep
CborLen and functions minicbor::len and minicbor::len_with to allow client
code to calculate the length in bytes of a value's CBOR representation. See issue [32][i32] and merge
request [23][mr23] for details.Remove feature partial-derive-support. Encode and Decode can always be derived. See commits 21060b3272d4d09af88aa8543f682c8c4477a886 and 9038d3cced197
partial-derive-support. Encode and Decode can always be derived. See
commits 21060b3272d4d09af88aa8543f682c8c4477a886 and 9038d3cced197588ae4d8d2c891d6f51029a9e7d
for details.encode::Write impls. The blanket impl for types implementing std::io::Write has
been removed. The impl for Vec<u8> now always uses Infallible as its error type and
minicbor::{to_vec, to_vec_with} no longer require feature "std". See commit
498043ddce69e3da0dcc66593afdeea0dd058fb8 for details.minicbor-derive-0.12.0.Fix missing import for cargo feature derive.
derive.Remove cargo feature partial-skip-support. The method Decoder::skip is now always available. With cargo feature alloc, every CBOR item can be skipped
partial-skip-support. The method Decoder::skip is now always available.
With cargo feature alloc, every CBOR item can be skipped over, otherwise attempting to skip
over indefinite-length arrays or maps inside of regular arrays or maps will result in an error.minicbor-derive-0.11.0.Specialise Cow<_, [u8]> by adding implementations of minicbor::{EncodeBytes, DecodeBytes}.
Cow<_, [u8]> by adding implementations of minicbor::bytes::{EncodeBytes, DecodeBytes}.- No change since 0.16.0-rc.1.
0.16.0-rc.1.⚠️ Breaking ⚠️: The Encode and Decode traits are now parameterised by a context type and the context value is passed as another argument to Encode::en
⚠️ Breaking ⚠️: The Encode and Decode traits are now parameterised by a context type and
the context value is passed as another argument to Encode::encode and Decode::decode (see
merge request [21][mr21] and issue [26][i26] for details).
Implementations of these traits that do not make use of the context need to be generic in the
type variable and accept the context parameter, e.g. instead of
struct T;
impl Encode for T {
fn encode<W: Write>(&self, e: &mut Encoder<W>) -> Result<(), Error<W::Error>> { ... }
}
impl<'b> Decode<'b> for T {
fn decode(d: &mut Decoder<'b>) -> Result<Self, Error> { ... }
}
one would now write:
struct T;
impl<C> Encode<C> for T {
fn encode<W: Write>(&self, e: &mut Encoder<W>, ctx: &mut C) -> Result<(), Error<W::Error>> { ... }
}
impl<'b, C> Decode<'b, C> for T {
fn decode(d: &mut Decoder<'b>, ctx: &mut C) -> Result<Self, Error> { ... }
}
⚠️ Breaking ⚠️: The type data::Cbor has been removed. To write pre-existing CBOR bytes use
Encoder::writer_mut with Write::write_all and to access raw CBOR bytes from the decoder use
Decoder::input.
⚠️ Breaking ⚠️: The AsRef impl for Encoder has been removed. Use Encoder::writer instead.
⚠️ Breaking ⚠️: The legacy module and feature flag have been removed.
Decoder::input has been added to get a reference to the input bytes.
The newtypes minicbor::encode::{ArrayIter, MapIter} have been added to encode any clonable
iterator as a CBOR array or map.
Several new methods have been added to Decoder and Encoder to work with contexts:
Decoder::decode_withDecoder::array_iter_withDecoder::map_iter_withEncoder::encode_withThese correspond to the existing variants without the _with suffix which do not accept a context
and fix the context type to (). Note that generic implementations of Decode and Encoder must
therefore use the versions which accept a context parameter.
Other additions include the crate-level functions:
encode_withdecode_withto_vec_with⚠️ Breaking ⚠️: The encoding of IP addresses changed (see commit fac39d5a). This affects the following types:
⚠️ Breaking ⚠️: The encoding of IP addresses changed (see commit fac39d5a). This affects the following types:
A new module minicbor::legacy is introduced which contains newtype wrappers for these types
which continue to use the array-based encoding. Users can opt out of the new compact format by
enabling the cargo feature "legacy" and importing the types from the legacy module.
A new type minicbor::data::Int has been introduced (see merge request [20][mr20]) to allow encoding
and decoding of the whole CBOR integer range [-2<sup>64</sup>, 2<sup>64</sup> - 1].
⚠️ Breaking ⚠️: As a consequence of adding the new Int type, a new constructor
minicbor::data::Type::Int has been added to denote those (signed) integers that do not fit
into an i64. Similarly the new constructor minicbor::decode::Token::Int captures those values.
Bugfix release: Imports alloc::ToString when necessary (see issue [21][i21]) for details.
alloc::string::ToString when necessary (see issue [21][i21]) for details.Maintenance release: Add position information to UTF-8 decoding errors.
⚠️ Breaking ⚠️: encode::Error and decode::Error are now structs instead of enums. The actual error representation is hidden and errors are constructed
encode::Error and decode::Error are now structs instead of enums.
The actual error representation is hidden and errors are constructed with functions instead
of creating enum values directly, for example Error::Message("foo") is now
Error::message("foo"). This was done to support adding more information to error values,
like the decoding position. For details see merge request [19][mr19].Added Decode impl for Box (see merge request [18][mr18] by @tailhook).
Decode impl for Box<str> (see merge request [18][mr18] by @tailhook).Bugfix: Decoder::datatype would sometimes report incorrect types for negative integers (see issue [18][i18] and commit 0bd97b72 for details).
Decoder::datatype would sometimes report incorrect types for negative integers
(see issue [18][i18] and commit 0bd97b72 for details).⚠️ Breaking ⚠️: Removed the Clone impl of decode::Error.
Clone impl of decode::Error.decode::Error::Custom (requires feature std) which contains an
arbitrary Box<dyn std::error::Error + Send + Sync>.Change Tokenizer::token to move to the end of decoding input when an error occurs. This is done because some errors do not cause consumption of the in
Tokenizer::token to move to the end of decoding input when an error occurs. This is
done because some errors do not cause consumption of the input, hence repeated calls to
Tokenizer::token may not terminate.Extend the optionality of fields beyond Option. This applies to derived impls of Encode and Decode which make use of newly added methods Encode::is_ni
Option. This applies to derived impls of Encode
and Decode which make use of newly added methods Encode::is_nil and Decode::nil
instead of Option::is_none and None. See issue [10][i10] and merge request [15][mr15] for details.Accept non-preferred integer encodings (see issue [14][i14] for details).
Decoder::{null, undefined} methods.data::Cbor as identity element of Encode and Decode.Bugfix: Decoding strings or bytes with a length of u64::MAX would cause an overflow of the internal decoder position value. This case is now properly
u64::MAX would cause an overflow of the
internal decoder position value. This case is now properly handled. See issue [12][i12] for details.partial-derive-support feature did not re-export minicbor-derive, nor did it
make the functionality of minicbor::bytes available. See merge request [14][mr14] by @dne1 for details.Bugfix release: Version 0.11.2 added Encode/Decode impls for various atomic types without considering their availability on the target platform (cf. i
0.11.2 added Encode/Decode impls for various atomic types without
considering their availability on the target platform (cf. issue [11][i11]). In here we attempt to
only offer impls for available atomic types (cf. merge request [13][mr13] for details).Improves minicbor::display to be more robust when applied to malformed CBOR values (see commit c1294dd for details).
minicbor::display to be more robust when applied to malformed CBOR values
(see commit c1294dd for details).Encode/Decode impls:
core::num::Wrappingcore::sync::atomic::{AtomicBool, AtomicI8, AtomicI16, AtomicI32, AtomicI64, AtomicIsize}core::sync::atomic::{AtomicU8, AtomicU16, AtomicU32, AtomicU64, AtomicUsize}core::cell::{Cell, RefCell}core::ops::{Bound, Range, RangeFrom, RangeInclusive, RangeTo, RangeToInclusive}std::path::{Path, PathBuf}std::time::SystemTimeDepends on minicbor-derive-0.7.1.
minicbor-derive-0.7.1.Depends on minicbor-derive-0.7.0.
minicbor-derive-0.7.0.Small bugfix release (see commit 68963dc for details).
⚠️ Breaking ⚠️: By default Decoder::skip is not available anymore. It can be enabled with feature flag "alloc" (implied by "std") or "partial-skip-sup
Decoder::skip is not available anymore. It can be enabled with
feature flag "alloc" (implied by "std") or "partial-skip-support". The latter variant
corresponds to the implementation of minicbor <= 0.9.1 but does not support skipping over
indefinite-length arrays or maps inside of regular arrays or maps. The variant enabled by
"alloc" supports skipping over arbitrary CBOR items. For more information see
[feature flags][3] and issue [9][i9].Adds a few more trait impls to ByteArray and ByteVec. See commit b17fe67.
ByteArray and ByteVec. See commit b17fe67.⚠️ Breaking ⚠️: The encoding of () and PhantomData has changed. See commit b6b1f907.
() and PhantomData has changed. See commit b6b1f907.decode::Error::TypeMismatch constructor changed to use a data::Type
instead of a u8 as its first parameter. See merge request [6][mr6] for details.alloc (implied by std), which enables most collections types in a no_std
environment. See merge request [9][mr9] for details.ByteArray to support compact encoding of u8-arrays, similarly to the already existing
ByteSlice and ByteVec types added in minicbor-0.6.0. See merge request [10][mr10] for details.Write impl for alloc::vec::Vec (see merge request [11][mr11] by @Hawk777).minicbor-derive-0.6.4.Depends on minicbor-derive-0.6.3.
minicbor-derive-0.6.3.⚠️ Breaking ⚠️: Change data::Type to distinguish between indefinite arrays, maps, bytes and strings, and regular ones by introducing constructors such
data::Type to distinguish between indefinite arrays, maps, bytes and
strings, and regular ones by introducing constructors such as Type::ArrayIndef.decode::Token and decode::Tokenizer to allow decoding CBOR bytes
generically as a mere sequence of tokens.display which displays CBOR bytes in [diagnostic notation][2].Bugfix: Type::read used 0xc9 instead of 0xc0 when reading Type::Tag.
Type::read used 0xc9 instead of 0xc0 when reading Type::Tag.Your coding agent can read these notes before it upgrades. Set up the MCP server →