#[derive(Debug, Clone)] pub enum Method { Get, Head, Post, Put, Delete, Connect, Options, Trace, Patch } impl Method { pub fn serialize(string: &str) -> Option { match string { "GET" => Some(Self::Get), "HEAD" => Some(Self::Head), "POST" => Some(Self::Post), "PUT" => Some(Self::Put), "DELETE" => Some(Self::Delete), "CONNECT" => Some(Self::Connect), "OPTIONS" => Some(Self::Options), "TRACE" => Some(Self::Trace), "PATCH" => Some(Self::Patch), _ => None } } }