0.8.2 - 2025-03-16
- Add
Value::as_list(),as_list_mut(), andis_list() - Add
deserialize_i128anddeserialize_u128support
- Remove duplicated code and forward implementations to
deserialize_any()to reduce code size.
- Add performance note when using IoRead
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
Valuevariants to useByteStringinstead ofserde_bytes::ByteBuffor byte string values. Removed theserde_bytesdependency.
- Add
ByteStringtype 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
Readtrait 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
Errortype.The
Error::byte_offset()method can help hint where the error occurred at (usually only helpful for deserialization).Refactored to use
Boxto 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
Writetrait and implementations.Thanks @bheesham.
0.5.1 - 2022-03-14
- Use
BytesforValues::Dictindex access instead of allocating aByteBuf.
0.5.0 - 2022-03-09
- Update to
itoaversion1.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
infokey which has a dictionary value:#[derive(Deserialize)] struct Metainfo { info: ByteBuf, }could be used to capture the raw bytes of the encoded
infodictionary 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
Readtrait and helper implementationsIoReadandSliceReadare made public.- Add
Valueas_number(). - Add multiple
Fromimplementations for all the common primitive signed and unsigned integers toNumber.
0.2.0 - 2020-02-20
Valuetype and related functions.
0.1.0 - 2020-02-20
Serializer,Deserializer, and related functions.