nskeyedunarchiver_derive

Crates.ionskeyedunarchiver_derive
lib.rsnskeyedunarchiver_derive
version0.1.0
created_at2025-05-28 15:24:40.202505+00
updated_at2025-05-28 15:24:40.202505+00
descriptionA helper derive macro for nskeyedunarchiver crate
homepage
repositoryhttps://github.com/michaelwright235/nskeyedunarchiver
max_upload_size
id1692946
size33,234
Michael Wright (michaelwright235)

documentation

README

nskeyedunarchiver_derive

Derive macro which generates an impl of the trait Decodable.

[Decodable] macro

The easiest way to make a type Decodable is to derive the Decodable macro for your struct or enum. Types of fields and variants should also implement Decodable trait.

The macro attribute is #[decodable(...)]. Every inner attribute is separated with a comma ,.

Container attributes

  • #[decodable(rename = "...")]: decodes a container with the given name instead of its Rust name.

Field and Variant attributes

  • #[decodable(rename = "...")]: decodes a field or variant with the given name instead of its Rust name.
  • #[decodable(skip)]: do not decode a field or variant. Doesn't work with other attributes.
  • #[decodable(default)]: if the value is not present when decoding, use the Default::default().

Field attributes only

  • #[decodable(unhandled)]: creates a hashmap of any values that are unhandled and thus hasn't been decoded. A field should have a type of HashMap<String, ObjectValue>.
Commit count: 116

cargo fmt