peta 0.0.3

Very small and simple http library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// TODO: Need to add most common statuses
pub enum StatusMessage {
  OK,
  NOT_FOUND,

  // custom status implementation
  Custom(u32, String),
}

impl std::fmt::Display for StatusMessage {
  fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
    match *self {
      StatusMessage::OK => f.pad("200 OK"),
      StatusMessage::NOT_FOUND => f.pad("404 Not Found"),
      StatusMessage::Custom(c, ref s) => write!(f, "{} {}", c, s),
    }
  }
}