Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getters and setters for new extensions #140

Closed
joksas opened this issue Sep 27, 2022 · 2 comments
Closed

Getters and setters for new extensions #140

joksas opened this issue Sep 27, 2022 · 2 comments

Comments

@joksas
Copy link

joksas commented Sep 27, 2022

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
Copy link
Member

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
Copy link
Author

joksas commented Sep 28, 2022

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

@joksas joksas closed this as completed Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants