Skip to content

Latest commit

 

History

History
680 lines (439 loc) · 21.1 KB

CHANGELOG.md

File metadata and controls

680 lines (439 loc) · 21.1 KB

Contents

minicbor

0.25.1

  • Update documentation.

0.25.0

  • 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 by @chrysn).

0.24.4

  • Maintenance release (documentation tweaks).

0.24.3

  • Maintenance release (cf. merge request 47 by @chrysn).

0.24.2

  • Maintenance release (cf. merge request 46 by @deundiak).

0.24.1

  • Maintenance release (cf. merge requests 44 by @alistair23 and 45 by @deundiak).

0.24.0

  • 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.

0.23.0

  • 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.

0.22.0

  • ⚠️ Breaking ⚠️: Tokenizer now has two lifetime parameters because it sometimes borrows the inner Decoder.
  • Tokens can now also be encoded (cf. merge request 37 by @alistair23). Methods Encoder::tokens and Decoder::tokens have been added.

0.21.1

  • Tag::new and Tag::as_u64 are now declared const (cf. merge request 36 by @DCNick3).

0.21.0

  • ⚠️ Breaking ⚠️: Tag handling has been reworked (cf. merge request 34). The Tag type is now merely a newtype around a u64. A new enum IanaTag represents registered tag values.

0.20.0

  • Support for decoding arrays of arbitrary length has been added (cf. merge request 31 by @samuelmhicks).
  • Added Encode and Decode impls for CStr and CString (cf. merge request 29).
  • Added decode::info::Size to allow length introspection of CBOR values (see merge requests 25 and 28 for details).

0.19.1

  • Bugfix release (see merge request 26 by @jeandudey for details).

0.19.0

  • 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 and merge request 23 for details.

0.18.0

  • 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.

0.17.1

  • Fix missing import for cargo feature derive.

0.17.0

  • 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.

0.16.1

  • Specialise Cow<_, [u8]> by adding implementations of minicbor::bytes::{EncodeBytes, DecodeBytes}.

0.16.0

  • 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::encode and Decode::decode (see merge request 21 and issue 26 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

0.15.0

  • ⚠️ 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) to allow encoding and decoding of the whole CBOR integer range [-264, 264 - 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.

0.14.2

  • Bugfix release: Imports alloc::string::ToString when necessary (see issue 21) for details.

0.14.1

  • Maintenance release: Add position information to UTF-8 decoding errors.

0.14.0

  • ⚠️ 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.

0.13.2

  • Added Decode impl for Box<str> (see merge request 18 by @tailhook).

0.13.1

  • Bugfix: Decoder::datatype would sometimes report incorrect types for negative integers (see issue 18 and commit 0bd97b72 for details).

0.13.0

  • ⚠️ 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>.

0.12.1

  • 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.

0.12.0

  • 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 and merge request 15 for details.

0.11.5

  • Accept non-preferred integer encodings (see issue 14 for details).
  • Added Decoder::{null, undefined} methods.
  • Added data::Cbor as identity element of Encode and Decode.

0.11.4

  • 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 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 by @dne1 for details.

0.11.3

  • 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). In here we attempt to only offer impls for available atomic types (cf. merge request 13 for details).

0.11.2

  • 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

0.11.1

  • Depends on minicbor-derive-0.7.1.

0.11.0

  • Depends on minicbor-derive-0.7.0.

0.10.1

  • Small bugfix release (see commit 68963dc for details).

0.10.0

  • ⚠️ 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 and issue 9.

0.9.1

  • Adds a few more trait impls to ByteArray and ByteVec. See commit b17fe67.

0.9.0

  • ⚠️ 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 for details.
  • Added feature flag alloc (implied by std), which enables most collections types in a no_std environment. See merge request 9 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 for details.
  • Added Write impl for alloc::vec::Vec (see merge request 11 by @Hawk777).
  • Depends on minicbor-derive-0.6.4.

0.8.1

  • Depends on minicbor-derive-0.6.3.

0.8.0

  • ⚠️ 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.

0.7.2

  • Bugfix: Type::read used 0xc9 instead of 0xc0 when reading Type::Tag.
  • Add README.md

0.7.1

  • Require minicbor-derive-0.6.1.

0.7.0

  • Require minicbor-derive-0.6.0.

0.6.0

  • Removes the &[u8] impl for Decode (see issue 4) and add a new module minicbor::bytes to support specialised encoding of CBOR bytes. This module provides the types ByteSlice and ByteVec which are substitutes for &[u8] and Vec<u8> respectively. See also the module documentation of minicbor::bytes.

0.5.1

  • Require minicbor-derive-0.4.1.

0.5.0

  • Require minicbor-derive-0.4.0.

0.4.1

  • Adds Encoder::f16 to support encoding of f32 values as half floats. Complements the existing Decoder::f16 method and depends on the feature half.

0.4.0

  • Added Encode and Decode impls for tuples (see merge request 1 by @koushiro).

minicbor-derive

0.15.3

  • Update documentation.

0.15.2

  • Maintenance release (documentation tweaks).

0.15.1

  • Maintenance release (documentation tweaks).

0.15.0

  • Added attribute skip for fields, which ignores the value during encoding and initialises it with Default::default() during decoding.
  • Added attribute tag to allow specifying the tag value which the subsequent value is encoded and decoded with.
  • Requires minicbor-0.24.0.

0.14.0

  • Upgrade dependency syn to version 2.0 (cf. commit 3a63fc304d380f2477959906a54b1f3dedc8ccef for details).
  • Requires minicbor-0.22.0.

0.13.0

  • Added the ability to derive the CborLen trait on structs and enums.
  • Requires minicbor-0.19.0.

0.12.0

  • Add features "alloc" and "std" to import the correct Cow depending on feature use. (See commit 21060b3272d4d09af88aa8543f682c8c4477a886 for details.)
  • Clarify what ignoring fields means and how it relates to the "alloc" feature. (See commit 9038d3cced197588ae4d8d2c891d6f51029a9e7d for details.)

0.11.0

  • Improve #[cbor(transparent)]: Previously, custom encode/decode functions where not allowed, preventing the use of with = "minicbor::bytes. Explicit borrowing from Cows did also not work, creating owned Cow values instead.

0.10.1

  • Update documentation due to changes in minicbor-0.16.1.

0.10.0

  • Small documentation update.

0.10.0-rc.1

  • Depends on minicbor-0.16.0-rc.1.
  • A new attribute context_bound has been added to allow constraining the generic context type of the derived Encode or Decode trait impl with a set of trait bounds.

0.9.0

  • Requires minicbor-0.14.0.

0.8.0

  • Uses Encode::is_nil and Decode::nil instead of Option::is_none and None to generalise field optionality.
  • Adds new attributes is_nil, nil and has_nil to enable integration of optional types which do not implement Encode or Decode.

0.7.2

  • Small bugfix release.

0.7.1

  • Small error reporting improvement (cf. 1b1cb41).

0.7.0

  • Major internal refactoring to make attribute parsing more flexible and robust.
  • Adds as new attributes encode_bound, decode_bound and bound to allow overriding the generated type parameter bounds.

0.6.4

  • Improve hygiene (see merge request 7).

0.6.3

  • Improve macro hygiene.

0.6.2

  • Add README.md

0.6.1

  • Maintenance release.

0.6.0

  • Adds #[cbor(index_only)] attribute to support a more compact encoding for enums without fields (read the documentation for details).

0.5.0

  • When deriving, the attribute #[cbor(with = "minicbor::bytes")] can be used for &[u8] and Option<&[u8]> if direct use of ByteSlice is not desired. See also the section "What about &[u8]?" in minicbor-derive.

0.4.1

  • Adds #[cbor(transparent)] to allow newtypes to use the same CBOR encoding as their inner type.

0.4.0

  • Adds #[cbor(encode_with)], #[cbor(decode_with) and #[cbor(with)] attributes to allow custom encode/decode functions which replace their trait counterparts or provide a way to handle types which do not implement these traits.

0.3.0

  • Added #[cbor(map)] and #[cbor(array)] attributes (see commit 40e8b240 for details).

minicbor-io

0.20.1

  • Update documentation.

0.20.0

  • Error types now implement core::error::Error, which was stabilised in Rust 1.81.
  • Requires minicbor-0.25.0.

0.19.1

  • Maintenance release (documentation tweaks).

0.19.0

  • Require minicbor-0.24.0.

0.18.0

  • Require minicbor-0.23.0.

0.17.0

  • Require minicbor-0.22.0.

0.16.1

  • Maintenance release.
  • Require at least minicbor-0.21.1.

0.16.0

  • Require at least minicbor-0.21.0.

0.15.0

  • Require at least minicbor-0.20.0.

0.14.0

  • Require at least minicbor-0.19.0.

0.13.0

  • Depend on minicbor-0.18.0.
  • minicbor_io::Error::Encode now contains a minicbor::encode::Error<Infallible>. (See commit 498043ddce69e3da0dcc66593afdeea0dd058fb8 for details.)

0.12.0

  • Depend on minicbor-0.17.0.

0.11.0

  • No change since 0.11.0-rc.1.

0.11.0-rc.1

  • Depends on minicbor-0.16.0-rc.1.

  • The following new methods have been added:

    • Reader::read_with
    • AsyncReader::read_with
    • Writer::write_with
    • AsyncWriter::write_with

    These accept an additional context parameter and the existing variants fix the context to the unit type.

0.10.0

  • Depends on minicbor-0.15.0.

0.9.0

  • Depends on minicbor-0.14.0.

0.8.0

  • Depends on minicbor-0.13.0.

0.7.0

  • Depends on minicbor-0.12.0.

0.6.0

  • Depends on minicbor-0.11.0.

0.5.0

  • Depends on minicbor-0.10.0.

0.4.0

  • Depends on minicbor-0.9.0.

0.3.1

  • Depends on minicbor-0.8.1.

0.3.0

  • Depends on minicbor-0.8.0.

0.2.3

  • Add README.md

0.2.2

  • Use same version for minicbor dependency in dependencies and dev-dependencies.

0.2.1

  • Reader and AsyncReader always return UnexpectedEof when reading 0 bytes while decoding a frame, unless at the very beginning of a frame, when not even the length prefix has been read, where Ok(None) would be returned instead. Previous versions returned Ok(None) while reading a partial length prefix.

0.1.2

  • Update dev-dependencies.

0.1.1

  • Fix link to documentation in Cargo.toml.

0.1.0

  • Initial release which provides some I/O utilities.

minicbor-serde

0.3.2

  • Add no_std attribute (see issue #3).

0.3.1

  • Update documentation.

0.3.0

  • Error types now implement core::error::Error, which was stabilised in Rust 1.81.
  • Deserializer::from_slice has been renamed to Deserializer::new and to_vec is available with feature alloc.
  • Requires minicbor-0.25.0.

0.2.1

  • Exports error module.

0.2.0

  • Maintenance release (documentation tweaks).

0.1.0

  • Initial release.