docs: mark response/result structs #[non_exhaustive] (whatsapp-rust#794) - #282
Conversation
Covers the pre-1.0 API stabilisation pass that marks 22 library-returned structs as #[non_exhaustive]. Adds a new changelog entry, updates the navigation, and annotates the affected struct definitions in the API reference pages (send, upload, groups, community, business, contacts).
…pantChangeResponse as #[non_exhaustive]
Reflects whatsapp-rust#794.
|
Warning Review limit reached
More reviews will be available in 30 minutes and 15 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a90dce210b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| ``` | ||
|
|
||
| `BusinessProfile` is `#[non_exhaustive]`. Field reads are unaffected; only exhaustive struct destructuring from outside the crate requires adding `..`. |
There was a problem hiding this comment.
Include construction in non_exhaustive guidance
For downstream crates, #[non_exhaustive] also forbids constructing BusinessProfile with struct-literal syntax; .. only fixes destructuring patterns. This wording says destructuring is the only affected operation, so users who previously built these public structs may follow incomplete migration guidance. The same newly added wording appears on the other response/result type notes and should mention external struct-literal construction as well.
Useful? React with 👍 / 👎.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Per review feedback, "only exhaustive struct destructuring" was inaccurate — struct-literal construction from outside the crate is also disallowed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fcf9900766
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| ``` | ||
|
|
||
| `SendResult` is `#[non_exhaustive]`. Field reads are unaffected; only exhaustive struct destructuring from outside the crate requires adding `..`. |
There was a problem hiding this comment.
Include construction in remaining notes
Fresh evidence: after construction guidance was added elsewhere, this added note still says the only external impact is exhaustive destructuring, but Rust also rejects struct-literal construction of a #[non_exhaustive] struct outside its defining crate. Consumers who fabricate SendResult in tests or adapters will follow incomplete migration guidance; the same wording appears on the newly added CreateGroupResult, ParticipantChangeResponse, and UploadResponse notes and should include construction or avoid saying “only”.
Useful? React with 👍 / 👎.
Summary
Reflects the changes from whatsapp-rust#794, which added
#[non_exhaustive]to all library-returned response and result structs as a pre-1.0 API stabilisation step.changelog/2026-06-09-non-exhaustive.mdx— new breaking-change entry listing all 17 affected types and the..migration patterndocs.json— added the new changelog page to the navigationapi/business.mdx— added#[non_exhaustive]toBusinessProfile,BusinessCategory,BusinessHours,BusinessHoursConfigapi/community.mdx— added#[non_exhaustive]toCreateCommunityResult,CommunitySubgroup,LinkSubgroupsResult,UnlinkSubgroupsResultapi/contacts.mdx— added#[non_exhaustive]note toUserInfoapi/send.mdx— added#[non_exhaustive]toSendResultapi/upload.mdx— added#[non_exhaustive]toUploadResponseapi/groups.mdx— added#[non_exhaustive]toCreateGroupResultandParticipantChangeResponseGenerated by Claude Code