Crates.io | statuses |
lib.rs | statuses |
version | 0.1.2 |
source | src |
created_at | 2022-11-12 08:37:03.281791 |
updated_at | 2022-11-12 09:12:21.619923 |
description | HTTP status utility for Rust |
homepage | |
repository | https://github.com/Kristories/statuses.rs |
max_upload_size | |
id | 713529 |
size | 6,831 |
HTTP status utility for Rust.
Put this in your Cargo.toml:
[dependencies]
statuses = "0.1"
message(code)
Returns the status message string for a known HTTP status code.
fn main() {
// Unprocessable Entity
println!("{}", statuses::message("422"));
}
code(message)
Returns the status code string for a known HTTP status message.
fn main() {
// 403
println!("{}", statuses::code("Forbidden"));
}