smithy-rs
smithy-rs copied to clipboard
Add `#[non_exhaustive]` to server builders
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.