amazon-ion / ion-rust

Rust implementation of Amazon Ion
Apache License 2.0
147 stars 35 forks source link

`StructBuilder`: support `with_annotations` #834

Open mtcalvin opened 3 weeks ago

mtcalvin commented 3 weeks ago

I'm using StructBuilder to dynamically construct/modify Ion structs. In addition to setting struct fields, I also need to add annotations to the struct.

Currently, I have to .build() the builder and then call .with_annotations([...]) on the result. It would be nice for API symmetry if annotations could be added/removed as part of the builder (like fields) instead of only on the resulting object.