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

Add #[non_exhaustive] to server builders #3685

Open
david-perez opened this issue Jun 7, 2024 · 1 comment
Open

Add #[non_exhaustive] to server builders #3685

david-perez opened this issue Jun 7, 2024 · 1 comment
Labels
server Rust server SDK

Comments

@david-perez
Copy link
Contributor

We add #[non_exhaustive] to client structures and builders, despite their fields being pub(crate), to prevent users from instantiating them using struct expressions in the case where they don't contain any fields.

We don't do the same for servers. Server structures are always pub with pub fields, because service owners are authoritative model consumers and should be able to directly use struct expressions to instantiate them. However, server builders do have pub(crate) fields but don't have #[non_exhaustive] on them.

@david-perez david-perez added breaking-change This will require a breaking change server Rust server SDK labels Jun 7, 2024
@david-perez
Copy link
Contributor Author

This actually has no effect because the builder's fields are pub(crate), and #[non_exhaustive] would only affect how users interact with it outside of the defining crate.

@david-perez david-perez removed the breaking-change This will require a breaking change label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server Rust server SDK
Projects
None yet
Development

No branches or pull requests

1 participant