near / borsh-rs

Rust implementation of Binary Object Representation Serializer for Hashing
https://borsh.io/
Apache License 2.0
321 stars 67 forks source link

feat: derive attribute for 3rd party structs/enums as fields #182

Closed dj8yfo closed 1 year ago

dj8yfo commented 1 year ago

resolves #13

dj8yfo commented 1 year ago

This repo is a runnable example of using the introduced:

  1. #[borsh(serialize_with = ..., deserialize_with = ...)]
  2. #[borsh(schema(with_funcs(declaration = ..., definitions = ...)))]

attributes for some of foreign types, mentioned in the initial issue:

  1. PrimaryMap
  2. IndexMap
dj8yfo commented 1 year ago

I'll be adding doc comments to borsh-derive/src/lib.rs in a commit and corrections to some minor typos in comments (i've noticed some already), but with respect to the code the pr is ready for review