chitey_server/guard.rs
1use http::Method;
2
3#[derive(Debug, Clone, PartialEq)]
4pub enum Guard {
5 Get = 0,
6 Post = 1,
7}
8
9// Implement <Method> == <Guard> comparisons
10impl PartialEq<Method> for Guard {
11 fn eq(&self, other: &Method) -> bool {
12 (*self == Guard::Get && other == Method::GET) ||
13 (*self == Guard::Post && other == Method::POST)
14 }
15}