ion-rust icon indicating copy to clipboard operation
ion-rust copied to clipboard

Remove feature gate for `Encoding`

Open desaikd opened this issue 1 year ago • 2 comments

Encoding is gated under a feature "experimental-lazy-reader". This needs to be removed for 1.0 release. Encoding and LazyEncoder share some similar functionalities and needs to be modified to keep only one of these.

desaikd avatar Jan 18 '24 19:01 desaikd

The practical effect of this change will be that Element::read_* and Element::write_* methods will be able to accept a ReadConfig and WriteConfig respectively, allowing users to (e.g.) specify a Catalog or request a particular version of Ion. These types also future-proof these methods by giving us an avenue by which to add more options without modifying the API.

zslayton avatar Feb 09 '24 14:02 zslayton

If we remove the feature gate for Encoding, then we need to add a feature gate specifically to the Ion 1.1 encodings (until the Ion 1.1 spec is finalized). Currently, the Cargo.toml file does not list any feature for Ion 1.1.

popematt avatar Feb 15 '24 19:02 popematt

Interestingly, I've learned that it's possible to expose a type that's generic over E: Encoding without making Encoding itself pub, which is nice. This is currently the case with WriteConfig<E: Encoding>. In light of that, I'm closing this for now. If anyone disagrees, please re-open this and we'll discuss.

zslayton avatar May 28 '24 13:05 zslayton