0.8.1 - 2024-05-15
- Update serde dependency to be more precise to ensure minimal versions are correct.
0.8.0 - 2023-12-31
- Breaking change: Modify
Value
variants to useByteString
instead ofserde_bytes::ByteBuf
for byte string values. Removed theserde_bytes
dependency.
- Add
ByteString
type as a specialized type for serialization and deserialization of bencoded strings.
0.7.0 - 2022-07-31
- Add
Deserializer::byte_offset()
to return the byte offset in the underlying source. It may be useful if there is trailing data. - Serialize and deserialize tuples and tuple structs.
- Allow deserialization from a borrowed
Value
. - Set supported Rust version to
1.36.0
. The MSRV is not guaranteed due to dependencies being free to bump their version.
-
In general, fewer allocations are made when parsing values.
-
Breaking change: Refactored the
Read
trait to allow borrowing against the original data.#[derive(Deserialize)] struct Info<'a> { name: Option<&'a str>, pieces: &'a [u8], }
should work now when using
from_slice
. -
Breaking change: Refactored the
Error
type.The
Error::byte_offset()
method can help hint where the error occurred at (usually only helpful for deserialization).Refactored to use
Box
to reduce the size of the return types. Rationale is influenced by Serde JSON issues/discussions where an allocation for an exceptional code path is acceptable.
0.6.1 - 2022-03-31
- Fix wrong error returned when parsing an invalid list.
- Add documentation to more items
- Add #[must_use] to more functions
0.6.0 - 2022-03-21
-
Allow serialization when no_std.
Adds
Write
trait and implementations.Thanks @bheesham.
0.5.1 - 2022-03-14
- Use
Bytes
forValues::Dict
index access instead of allocating aByteBuf
.
0.5.0 - 2022-03-09
- Update to
itoa
version1.0.1
.
0.4.0 - 2021-05-27
-
Allow deserialization of non-byte string values into raw byte buffers. In cases where a value is a non-byte string, a byte buffer can be used to capture the raw encoded value. For instance, assuming a dictionary with an
info
key which has a dictionary value:#[derive(Deserialize)] struct Metainfo { info: ByteBuf, }
could be used to capture the raw bytes of the encoded
info
dictionary value.For untrusted input, the value should be verified as having the correct type (e.g. a dictionary) instead of a byte string which contains the raw encoded value.
0.3.0 - 2020-10-10
Read
trait and helper implementationsIoRead
andSliceRead
are made public.- Add
Value
as_number()
. - Add multiple
From
implementations for all the common primitive signed and unsigned integers toNumber
.
0.2.0 - 2020-02-20
Value
type and related functions.
0.1.0 - 2020-02-20
Serializer
,Deserializer
, and related functions.