-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Status::Other(n) status code to represent arbitrary values
This replaces the `Status::Unknown` variant with a `Status::Other(n)` variant that can be used to represent arbitrary status codes. RFC 9110 defines a number of status codes that aren't currently specified as enum variants, and servers may return other arbitrary codes. This change allows `Status` to represent any arbitrary code, rather than collapsing unknown codes to a single value. This does break backwards compatibility, as the `Status` variant can no longer be trivial converted to a u16 (and it now requires more space to store). This also results in having more than one way to represent some status codes. e.g., `Status::Ok` and `Status::Other(200)` are both treated as equal now.
- Loading branch information
Showing
1 changed file
with
58 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters