PackageTrack
Sign in Get early access

minicbor

A small CBOR codec suitable for no_std environments.

2.3.0 13M downloads/mo #2673 most downloaded on crates.io twittner/minicbor

What this package is like to depend on

Last release 1 months ago

23 Jul 2026

Ships fairly regularly

a new release about every 4 weeks

Nearly every release is documented

notes for 70 of 70 stable releases

Nothing withdrawn

no release was ever pulled

6 years old

71 releases · first in 2020

7 releases in the last 12 months

see the full history below

Release timeline

71 releases · Mar 2020 to Jul 2026
2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 60 of 71
  1. 2.3.0 23 Jul 2026
    Release notes
    • Adds support for u128/i128. See pull request [63][pr63] by @sdbondi for details.
    Open source →
  2. 2.2.3 20 Jul 2026
    Release notes
    • The std feature is no longer required for:
      • IpAddr,
      • Ipv4Addr,
      • Ipv6Addr,
      • SocketAddr,
      • SocketAddrV4,
      • SocketAddrV6.
    • Depends on minicbor-derive-0.19.5.
    Open source →
  3. 2.2.2 17 May 2026
    Release notes
    • Fixes bugs related to CborLen calculation, see commit cb19b238e5245729932a9cf9611818be1dc20ab6 for details.
    • Depends on minicbor-derive-0.19.4.
    Open source →
  4. 2.2.1 24 Feb 2026
    Release notes
    • Depends on minicbor-derive-0.19.3.
    Open source →
  5. 2.2.0 01 Feb 2026
    Release notes
    • Depends on minicbor-derive-0.19.0.
    Open source →
  6. 2.1.3 24 Nov 2025
    Release notes
    • Depends on minicbor-derive-0.18.3.
    Open source →
  7. 2.1.2 21 Nov 2025
    Release notes
    • Replaces build.rs with target_has_atomic. See pull request [47][pr47] by @dtolnay for details.
    Open source →
  8. 2.1.1 23 Aug 2025
    Release notes
    • Depends on minicbor-derive-0.18.2.
    Open source →
  9. 2.1.0 16 Aug 2025
    Release notes
    • Added Encoder::str_len, mirroring Encoder::bytes_len which was added in 0.26.1.
    • Depends on minicbor-derive-0.18.1.
    Open source →
  10. 2.0.0 23 Jul 2025
    Release notes
    • 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 T
      • Box<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.

    Open source →
  11. 1.1.0 22 Jul 2025
    Release notes
    • Adds encode::Error::{as_write, into_write} to allow easier access to an error caused by a Write implementation.
    Open source →
  12. 1.0.0 18 May 2025
    Release notes
    • Updated to 2024 edition.
    Open source →
  13. 0.26.5 27 Apr 2025
    Release notes
    • Add encode::write::Cursor::set_position.
    Open source →
  14. 0.26.4 12 Apr 2025
    Release notes
    • Implementations of Iterator::size_hint for decode::{ArrayIter, ArrayIterWithCtx}, decode::{MapIter, MapIterWithCtx}anddecode::{BytesIter, StrIter}` (see pull request [27][pr27] by @carloskiki for details).
    • Fixes an issue with 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.
    • Implements EncodeBytes, DecodeBytes and CborLenBytes for Box<[u8]> (see pull request [28][pr28] by @carloskiki for details).
    Open source →
  15. 0.26.3 20 Mar 2025
    Release notes
    • Depends on minicbor-derive-0.16.2.
    Open source →
  16. 0.26.2 16 Mar 2025
    Release notes
    • Fixes issue with minicbor::display (see issue [25][i25]) for details.
    • Depends on minicbor-derive-0.16.1.
    Open source →
  17. 0.26.1 01 Mar 2025
    Release notes
    • 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 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.
    Open source →
  18. 0.26.0 18 Feb 2025
    Release notes
    • Depends on minicbor-derive-0.16.0.
    Open source →
  19. 0.25.1 12 Sep 2024
    Release notes
    • Update documentation.
    Open source →
  20. 0.25.0 10 Sep 2024
    Release notes
    • Error types now implement 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).
    Open source →
  21. 0.24.4 04 Sep 2024
    Release notes
    • Maintenance release (documentation tweaks).
    Open source →
  22. 0.24.3 03 Sep 2024
    Release notes
    • Maintenance release (cf. merge request [47][mr47] by @chrysn).
    Open source →
  23. 0.24.2 28 Jun 2024
    Release notes
    • Maintenance release (cf. merge request [46][mr46] by @deundiak).
    Open source →
  24. 0.24.1 18 Jun 2024
    Release notes
    • Maintenance release (cf. merge requests [44][mr44] by @alistair23 and [45][mr45] by @deundiak).
    Open source →
  25. 0.24.0 17 Apr 2024
    Release notes
    • Added minicbor::data::Tagged, a newtype with a statically attached numeric tag.
    • Added attributes skip and tag (see minicbor-derive-0.15.0 for details).
    • Depend on minicbor-derive-0.15.0.
    Open source →
  26. 0.23.0 10 Apr 2024
    Release notes
    • Moved Token from minicbor::decode to minicbor::data. Token also implements Decode now.
    • Removed the deprecated Encoder::into_inner method. Use Encoder::into_writer instead.
    Open source →
  27. 0.22.0 09 Apr 2024
    Release notes
    • ⚠️ Breaking ⚠️: 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.
    Open source →
  28. 0.21.1 28 Mar 2024
    Release notes
    • Tag::new and Tag::as_u64 are now declared const (cf. merge request [36][mr36] by @DCNick3).
    Open source →
  29. 0.21.0 28 Feb 2024
    Release notes
    • ⚠️ 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 represents registered tag values.
    Open source →
  30. 0.20.0 24 Sep 2023
    Release notes
    • Support for decoding arrays of arbitrary length has been added (cf. merge request [31][mr31] by @samuelmhicks).
    • Added Encode and Decode impls for CStr and CString (cf. merge request [29][mr29]).
    • Added decode::info::Size to allow length introspection of CBOR values (see merge requests [25][mr25] and [28][mr28] for details).
    Open source →
  31. 0.19.1 10 Mar 2023
    Release notes
    • Bugfix release (see merge request [26][mr26] by @jeandudey for details).
    Open source →
  32. 0.19.0 17 Dec 2022
    Release notes
    • 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 representation. See issue [32][i32] and merge request [23][mr23] for details.
    Open source →
  33. 0.18.0 19 Jun 2022
    Release notes
    • Remove feature partial-derive-support. Encode and Decode can always be derived. See commits 21060b3272d4d09af88aa8543f682c8c4477a886 and 9038d3cced197588ae4d8d2c891d6f51029a9e7d for details.
    • Rework 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.
    • Depend on minicbor-derive-0.12.0.
    Open source →
  34. 0.17.1 01 Jun 2022
    Release notes
    • Fix missing import for cargo feature derive.
    Open source →
  35. 0.17.0 01 Jun 2022
    Release notes
    • Remove cargo feature 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.
    • Depend on minicbor-derive-0.11.0.
    Open source →
  36. 0.16.1 27 May 2022
    Release notes
    • Specialise Cow<_, [u8]> by adding implementations of minicbor::bytes::{EncodeBytes, DecodeBytes}.
    Open source →
  37. 0.16.0 08 May 2022
    Release notes
    • No change since 0.16.0-rc.1.
    Open source →
  38. 0.16.0-rc.1 01 May 2022 pre-release
    Release notes
    • ⚠️ 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_with
      • Decoder::array_iter_with
      • Decoder::map_iter_with
      • Encoder::encode_with

      These 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_with
      • decode_with
      • to_vec_with
    Open source →
  39. 0.15.0 13 Mar 2022
    Release notes
    • ⚠️ Breaking ⚠️: The encoding of IP addresses changed (see commit fac39d5a). This affects the following types:

      • std::net::IpAddr
      • std::net::Ipv4Addr
      • std::net::Ipv6Addr
      • std::net::SocketAddr
      • std::net::SocketAddrV4
      • std::net::SocketAddrV6

      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.

    Open source →
  40. 0.14.2 12 Mar 2022
    Release notes
    • Bugfix release: Imports alloc::string::ToString when necessary (see issue [21][i21]) for details.
    Open source →
  41. 0.14.1 27 Feb 2022
    Release notes
    • Maintenance release: Add position information to UTF-8 decoding errors.
    Open source →
  42. 0.14.0 20 Feb 2022
    Release notes
    • ⚠️ Breaking ⚠️: 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].
    Open source →
  43. 0.13.2 06 Feb 2022
    Release notes
    • Added Decode impl for Box<str> (see merge request [18][mr18] by @tailhook).
    Open source →
  44. 0.13.1 03 Feb 2022
    Release notes
    • Bugfix: Decoder::datatype would sometimes report incorrect types for negative integers (see issue [18][i18] and commit 0bd97b72 for details).
    Open source →
  45. 0.13.0 30 Jan 2022
    Release notes
    • ⚠️ Breaking ⚠️: Removed the Clone impl of decode::Error.
    • Added a new variant decode::Error::Custom (requires feature std) which contains an arbitrary Box<dyn std::error::Error + Send + Sync>.
    Open source →
  46. 0.12.1 02 Jan 2022
    Release notes
    • 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 input, hence repeated calls to Tokenizer::token may not terminate.
    Open source →
  47. 0.12.0 29 Nov 2021
    Release notes
    • 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_nil and Decode::nil instead of Option::is_none and None. See issue [10][i10] and merge request [15][mr15] for details.
    Open source →
  48. 0.11.5 21 Nov 2021
    Release notes
    • Accept non-preferred integer encodings (see issue [14][i14] for details).
    • Added Decoder::{null, undefined} methods.
    • Added data::Cbor as identity element of Encode and Decode.
    Open source →
  49. 0.11.4 30 Oct 2021
    Release notes
    • 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 handled. See issue [12][i12] for details.
    • Bugfix: The 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.
    Open source →
  50. 0.11.3 24 Sep 2021
    Release notes
    • Bugfix release: Version 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).
    Open source →
  51. 0.11.2 19 Sep 2021
    Release notes
    • Improves minicbor::display to be more robust when applied to malformed CBOR values (see commit c1294dd for details).
    • Adds several Encode/Decode impls:
      • core::num::Wrapping
      • core::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::SystemTime
    Open source →
  52. 0.11.1 23 Aug 2021
    Release notes
    • Depends on minicbor-derive-0.7.1.
    Open source →
  53. 0.11.0 22 Aug 2021
    Release notes
    • Depends on minicbor-derive-0.7.0.
    Open source →
  54. 0.10.1 22 Aug 2021
    Release notes
    • Small bugfix release (see commit 68963dc for details).
    Open source →
  55. 0.10.0 02 Aug 2021
    Release notes
    • ⚠️ Breaking ⚠️: By default 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].
    Open source →
  56. 0.9.1 25 Jul 2021
    Release notes
    • Adds a few more trait impls to ByteArray and ByteVec. See commit b17fe67.
    Open source →
  57. 0.9.0 21 Jul 2021
    Release notes
    • ⚠️ Breaking ⚠️: The encoding of () and PhantomData has changed. See commit b6b1f907.
    • ⚠️ Breaking ⚠️: The 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.
    • Added feature flag alloc (implied by std), which enables most collections types in a no_std environment. See merge request [9][mr9] for details.
    • Added 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.
    • Added Write impl for alloc::vec::Vec (see merge request [11][mr11] by @Hawk777).
    • Depends on minicbor-derive-0.6.4.
    Open source →
  58. 0.8.1 12 Apr 2021
    Release notes
    • Depends on minicbor-derive-0.6.3.
    Open source →
  59. 0.8.0 14 Mar 2021
    Release notes
    • ⚠️ Breaking ⚠️: Change data::Type to distinguish between indefinite arrays, maps, bytes and strings, and regular ones by introducing constructors such as Type::ArrayIndef.
    • Add new types decode::Token and decode::Tokenizer to allow decoding CBOR bytes generically as a mere sequence of tokens.
    • Add a function display which displays CBOR bytes in [diagnostic notation][2].
    Open source →
  60. 0.7.2 28 Feb 2021
    Release notes
    • Bugfix: Type::read used 0xc9 instead of 0xc0 when reading Type::Tag.
    • Add README.md
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive