smithy-rs icon indicating copy to clipboard operation
smithy-rs copied to clipboard

Add `#[non_exhaustive]` to server builders

Open david-perez opened this issue 8 months ago • 1 comments

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 avatar Jun 07 '24 09:06 david-perez