Skip to main content

Breaking changes

Response and result structs are #[non_exhaustive] (#794) #[non_exhaustive] has been applied to all public structs the library returns to consumers but never requires consumers to construct. IsOnWhatsAppResult already carried the attribute; this pass extends it to the remaining types before 1.0, while adding new fields is still cheap. Affected types: wacore:
  • UserInfo, LidQueryResponse
  • BusinessProfile, BusinessHours, BusinessHoursConfig, BusinessCategory
  • GroupInfoResponse, GroupParticipantResponse, GroupParticipatingResponse, ParticipantChangeResponse
whatsapp-rust:
  • SendResult, UploadResponse
  • CreateGroupResult
  • CreateCommunityResult, CommunitySubgroup, LinkSubgroupsResult, UnlinkSubgroupsResult
What changes: External crates can no longer construct these types via struct-literal syntax or match them exhaustively without a .. wildcard. Field reads are unaffected. In practice: The library constructs all of these — consumers only receive them. The PR confirmed zero struct-literal constructions outside the defining crate, so the attribute enforces the already-intended API contract. Migration: Add .. to any exhaustive struct destructuring patterns:
// Before (fails to compile outside the crate):
let SendResult { message_id, to } = result;

// After:
let SendResult { message_id, to, .. } = result;