use crate::*;
use std::fmt::{self, Display};
impl Default for Methods {
#[inline]
fn default() -> Self {
Self::GET
}
}
impl Methods {
#[inline]
pub fn new() -> Self {
Self::default()
}
#[inline]
pub fn is_get(&self) -> bool {
self.to_owned() == Self::GET.to_owned()
}
#[inline]
pub fn is_post(&self) -> bool {
self.to_owned() == Self::POST.to_owned()
}
}
impl Display for Methods {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let res: &str = match self {
Self::GET => GET,
Self::POST => POST,
};
write!(f, "{}", res)
}
}