You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
We add
#[non_exhaustive]
to client structures and builders, despite their fields beingpub(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
withpub
fields, because service owners are authoritative model consumers and should be able to directly use struct expressions to instantiate them. However, server builders do havepub(crate)
fields but don't have#[non_exhaustive]
on them.The text was updated successfully, but these errors were encountered: