| Crates.io | statuses |
| lib.rs | statuses |
| version | 0.2.0 |
| created_at | 2022-11-12 08:37:03.281791+00 |
| updated_at | 2025-06-15 15:24:19.102469+00 |
| description | HTTP status utility for Rust |
| homepage | |
| repository | https://github.com/Kristories/statuses.rs |
| max_upload_size | |
| id | 713529 |
| size | 30,852 |
HTTP status code utility for Rust — simple and lightweight mapping between HTTP status codes and their standard messages.
Add statuses to your Cargo.toml:
[dependencies]
statuses = "0.2"
Get message from status code:
use statuses::message;
fn main() -> Result<(), statuses::StatusError> {
let msg = message("422")?;
println!("{}", msg); // Output: Unprocessable Entity
Ok(())
}
Get code from status message:
use statuses::code;
fn main() -> Result<(), statuses::StatusError> {
let code = code("Forbidden")?;
println!("{}", code); // Output: 403
Ok(())
}
This project is licensed under the MIT License — see the LICENSE file for details.