httpcodes/
decl.rs

1#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2/// Represents a range of codes, i.e Informational (1xx)
3pub struct CodeRange<'a> {
4    /// The name of the range, i.e Informational
5    pub name: &'a str,
6    /// The MDN reference for the documentation for this range
7    pub reference: &'a str,
8    /// The range of codes, i.e 1xx
9    pub range: &'a str,
10    /// The codes in this range
11    pub codes: &'a [Code<'a>],
12}
13
14/// Represents a single code, i.e 200 OK
15#[derive(Debug, Clone, PartialEq, Eq, Hash)]
16pub struct Code<'a> {
17    /// The message for the code, i.e OK
18    pub message: &'a str,
19    /// The code itself, i.e 200
20    pub code: u16,
21}