1 unstable release

Uses old Rust 2015

0.10.0 Feb 20, 2017

#28 in #http-status


Used in uhttp_json_api

MIT license

35KB
441 lines

uhttp_status -- HTTP status code formatter

Documentation

This crate provides an HTTP status code formatter, split out from hyper.rs.

Example

use uhttp_status::{StatusCode, StatusClass};

assert_eq!(format!("{}", StatusCode::NotFound), "404 Not Found");
assert_eq!(format!("{}", StatusCode::Ok), "200 OK");
assert_eq!(StatusCode::NotImplemented.class(), StatusClass::ServerError);

Usage

This crate can be used through cargo by adding it as a dependency in Cargo.toml:

[dependencies]
uhttp_status = "0.10.0"

and importing it in the crate root:

extern crate uhttp_status;

lib.rs:

This crate provides an HTTP status code formatter, split out from hyper.rs.

Example

use uhttp_status::{StatusCode, StatusClass};

assert_eq!(format!("{}", StatusCode::NotFound), "404 Not Found");
assert_eq!(format!("{}", StatusCode::Ok), "200 OK");
assert_eq!(StatusCode::NotImplemented.class(), StatusClass::ServerError);

No runtime deps