v3.0.0
Breaking Changes
-
#9
Value::from_serialize
now returns aResult
. Previously, if a Serialize
implementation returned an error, the function would panic. Thanks to
@wackbyte for finding this. -
Reader::buffered_read_bytes
now takes a third parameter,scratch: &mut Vec<u8>
and returns a new typeBufferedBytes
. This allows callers to supply
a buffer for reading bytes into rather than requiring implementors allocate
new buffers. -
PartialEq
forValue
has been changed such that if the bytes contained by a
string match the bytes contained by a byte value, the values now compare as
equal. Previously, all discriminants required exact matches.This was done due to Pot not knowing whether a value is a string or bytes when
serialized. Bytes are auto-promoted to string if the bytes are valid UTF-8 in
Value deserialization. -
SymbolMap
now utilizes a new structureSymbolList
for managing symbols.
This type optimizes storage of symbols when they are not borrowed from the
deserialization source. -
format::write_atom_header
no longer accepts an option for thearg
parameter. -
format::read_atom
now accepts ascratch: &mut Vec<u8>
parameter which is
used when reading an associatedNucleus::Bytes
. WhenNucleus::Bytes
containsBufferedBytes::Scratch
,scratch
will contain the bytes contained
in the atom. -
SymbolMapRef
is now a struct with private contents. -
Error
is now#[non_exhaustive]
. -
format::Float
andformat::Integer
no longer implement
Serialize
/Deserialize
. These implementations were derived but never
actually used. To improve this crate's build parallelization, a decision was
made to remove these usages of serde's derive macro. Implementing these traits
would be trivial, but the crate maintainer doesn't believe anyone is actually
using these implementations, so they were intentionally skipped. Please file
an issue if this affected you and you would like to see these implementations
added again.
Changed
pot::Result<T>
is nowpot::Result<T,E = pot::Error>
. This avoids issues
with other code whenpot::Result
is imported.ValueIter
is now exported. This is the type returned fromValue::values()
.- The Minimum Supported Rust Version (MSRV) has been set to 1.70. This MSRV was
chosen at the time due to dependencies also requiring this MSRV. - Tracing instrumentation has been changed from the default level of INFO to
TRACE. - This crate no longer activates the
derive
feature ofserde
.
Added
-
OwnedValue
now implementsFrom
forValue<'_>
and&Value<'_>
. -
Value
now implementsFromIterator<T>
whereT: Into<Value<'a>>
. The
result will be the variantValue::Sequence
. -
Value
now implementsFromIterator<(K, V)>
whereK: Into<Value<'a>>, V: Into<Value<'a>>
. The result will be the variantValue::Mappings
. -
de::SymbolMap
andser::SymbolMap
now both implementSerialize
and
Deserialize
using the same serialization strategy. This allows preshared
dictionaries to be used, and for state to be saved and restored. -
de::SymbolMap
andser::SymbolMap
have new convenience methods that allow
serializing and deserializing values directly:de::SymbolMap::deserialize_slice
de::SymbolMap::deserialize_from
ser::SymbolMap::serialize_to_vec
ser::SymbolMap::serialize_to