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
use std::{error::Error, fmt};

#[derive(Debug, Clone)]
#[cfg_attr(test, derive(PartialEq))]
pub struct InvalidHeaderName {
    pub(crate) byte: u8,
}

impl fmt::Display for InvalidHeaderName {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "invalid header name char {:?}", char::from(self.byte),)
    }
}

impl Error for InvalidHeaderName {}