1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
pub enum Command<'a> { Put { content: &'a [u8], content_type: &'a str, }, Get, Delete, List { prefix: &'a str, delimiter: Option<&'a str>, }, } impl<'a> Command<'a> { pub fn http_verb(&self) -> &'static str { match *self { Command::Get => "GET", Command::Put { .. } => "PUT", Command::Delete => "DELETE", Command::List { .. } => "GET", } } }