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