http_type/methods/
impl.rs1use crate::*;
2
3impl Default for Methods {
4 #[inline]
5 fn default() -> Self {
6 Self::GET
7 }
8}
9
10impl Methods {
12 #[inline]
16 pub fn new() -> Self {
17 Self::default()
18 }
19
20 #[inline]
24 pub fn is_get(&self) -> bool {
25 self.to_owned() == Self::GET.to_owned()
26 }
27
28 #[inline]
32 pub fn is_post(&self) -> bool {
33 self.to_owned() == Self::POST.to_owned()
34 }
35}
36
37impl Display for Methods {
38 #[inline]
39 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
40 let res: &str = match self {
41 Self::GET => GET,
42 Self::POST => POST,
43 };
44 write!(f, "{}", res)
45 }
46}