use std::fmt::{Display, Formatter, Result};
#[derive(Debug)]
pub enum HttpMethod {
Get,
Post,
Put,
Delete,
}
impl Display for HttpMethod {
fn fmt(&self, formatter: &mut Formatter) -> Result {
write!(formatter, "{}", self.as_str())
}
}
impl HttpMethod {
pub fn as_str(&self) -> &str {
match self {
HttpMethod::Get => "GET",
HttpMethod::Post => "POST",
HttpMethod::Put => "PUT",
HttpMethod::Delete => "DELETE",
}
}
}