All notable changes to this crate are documented in this file.
The format is based on Keep a Changelog, and this crate adheres to Semantic Versioning.
- Optimised the Decode::decode for [T; N] #299
- Migrated to 2021 edition, enforcing MSRV of
1.56.1
. #298 - Upgrade to BitVec 1.0 #311
- DecodeLimit and DecodeAll extensions now advance input #314
- Add bytes::Bytes implementation #309
decode_and_advance_with_depth_limit
to theDecodeLimit
trait. This allows advancing the cursor while decoding the input. PR #286
- Add support for custom where bounds
codec(mel_bound(T: MaxEncodedLen))
when deriving the traits. PR #279 MaxEncodedLen
trait for items that have a statically known maximum encoded size. (#268)#[codec(crate = <path>)]
top-level attribute to be used with the newMaxEncodedLen
trait, which allows to specify a different path to the crate that contains theMaxEncodedLen
trait. Useful when using generating a type through a macro and this type should implementMaxEncodedLen
and the final crate doesn't haveparity-scale-codec
as dependency.
- Lint attributes now pass through to the derived impls of
Encode
,Decode
andCompactAs
. PR #272
- Add support for custom where bounds
codec(encode_bound(T: Encode))
andcodec(decode_bound(T: Decode))
when deriving the traits. Pr #262 - Switch to const generics for array implementations. Pr #261
- Fix type inference issue in
Decode
derive macro. Pr #254
Decode::skip
allows to skip some encoded types. Pr #243Decode::encoded_fixed_size
allows to get the fixed encoded size of a type. PR #243Error
now contains a chain of causes. This full error description can also be activated on no std using the featurechain-error
. PR #242Encode::encoded_size
allows to get the encoded size of a type more efficiently. PR #245
CompactAs::decode_from
now returns result. This allow for decoding to fail from their compact form.- derive macro use literal index e.g.
#[codec(index = 15)]
instead of#[codec(index = "15")]
- Version of crates
bitvec
andgeneric-array
is updated. Encode::encode_to
now bounds the genericW: Output + ?Sized
instead ofW: Output
.Output
can now be used as a trait object.
EncodeAppend::append
is removed in favor ofEncodeAppend::append_or_new
.Output::push
is removed in favor ofEncode::encode_to
.- Some bounds on
HasCompact::Type
are removed. Error::what
is removed in favor ofError::to_string
(implemented through traitDisplay
).Error::description
is removed in favor ofError::to_string
(implemented through traitDisplay
).