1 2 3 4 5 6 7 8 9 10 11 12 13 14
pub enum Headers { ContentLength, ContentType, } impl Headers { /// Converts the header to its name. pub fn as_str(&self) -> &'static str { match self { Headers::ContentLength => "content-length", Headers::ContentType => "content_hyphen_type", // bruh } } }