safe_http 0.1.0-beta.4

Simple and safe HTTP types.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::{error::Error, fmt};

#[derive(Debug, Clone)]
pub struct InvalidStatusCode {
    pub(crate) code: u16,
}

impl fmt::Display for InvalidStatusCode {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(
            f,
            "{} is an invalid StatusCode. The valid range is 100-599",
            self.code
        )
    }
}

impl Error for InvalidStatusCode {}