rust-syndication / rss

Library for serializing the RSS web content syndication format
https://crates.io/crates/rss
Apache License 2.0
419 stars 52 forks source link

Getters and setters for new extensions #140

Closed joksas closed 1 year ago

joksas commented 1 year ago

Thank you for this library!

I'm currently working on adding podcast namespace support (also mentioned in #137) and was wondering about the requirements for new extensions.

After seeing that the fields are public, I found #71 and #94. I understand that keeping getters and setters is important for existing structs to ensure backwards compatibility. But are they also needed for newly added extensions? For consistency, I assume the answer is probably yes but just want to make sure because that's a lot of redundant code.

andy128k commented 1 year ago

Both options (to have public fields or to have private fields and getters/setters) have pros and cons. Unfortunately the crate was released as 1.x and later as 2.x. Picking one of the sides will require to release a new major version.

So, there is no better choice (yet) but to use public fields together with getters/setters (and derived builders, and serde traits).

joksas commented 1 year ago

That's alright, thank you for letting me know.