Skip to content

πŸ”– zvariant 5.5.0

Choose a tag to compare

@github-actions github-actions released this 03 May 20:08
· 688 commits to main since this release
zvariant-5.5.0
5874e7c
  • πŸš‘οΈ Ensure empty array is (de)serialized the same way as unit type.
  • ✨ Add as_value module. This new module provides API that can be used with serde::{Serialize::Deserialize} derives to (de)serialize a value as a Value (variant type). This is espcially useful for (de)serialization of structs as a dictionary (a{sv}).
  • πŸ—‘οΈ Deprecate SerializeDict & DeserializeDict macro. Now that user can directly use serde::{Serialize, Deserialize} for dict encoding of a struct, we don't need these anymore.
  • 🚚 Move SerializeValue & DeserializeValue into as_value & rename. These types belong in as_value module and given the context, we can just name them Serialize and Deserialize. We still provide type aliases to not break the API.
  • πŸ“ Improve Str docs.
  • πŸš‘οΈ Correctly handle identifier de for gvariant. We basically just need to do it exactly the same way as we do for the D-Bus format.
  • πŸš‘οΈ More robust deserialization of variants. Our deserializers rely on a specific behavior from the Value's Deserialize impls, and that fails when Value is being deserialized in a generic way (through deserialize_any or deserialize_ignored_any) and we end up with overflowing the stack. This happens for example when ignoring unknown fields/entries. Unfortunately, in case of GVariant we now no longer error out if a null byte is missing in a string type. You can blame Allison Lortie for removing the null-termination from a signature only when it is encoded in a variant but not otherwise. :)
  • ✨ Allow structs to be serialized as dictionaries.
  • ✨ zb,zn,Implement Borrow for Owned* types. Implementing Borrow makes things such as using Owned* types as keys easier, and it was more-or-less designed for this type of scenario anyway. Although it comes with some stringent requirements (i.e. traits implemented on the owned type need to have identical behavior to the borrowed type), all of these types are already rather thin wrappers to begin with.
  • βž– Drop static_assertions dep.
  • πŸ› fix wrong lifetime when creating a Value from &Vec and &[]. When creating a Value from a borrowed vec or slice using Value's From implementation, the compiler would wrongfully assume, that the created value has the same lifetime, even though the input gets cloned when creating the Array struct. This commit makes the impl assign a new lifetime to the cloned value.
  • ✨ Implement rename/rename_all when deriving Value/OwnedValue. Previously, setting these values would not apply to implementations of From and TryFrom when converting between a type and Value/OwnedValue. This change makes it so using rename or rename_all will apply to these traits. #320
  • ✨ *Value derive macros:
    • Support string encoding for enums.
    • Support enum variants without explicit values.
  • πŸ› Prefix a local variable w/ __ so it doesn't conflict w/ fields. ..in the struct deriving DeserializeDict. #1252.