| 4 | use http::method::InvalidMethod; |
| 5 | |
| 6 | pub(crate) fn to_wasi_method(value: Method) -> WasiMethod { |
| 7 | match value { |
| 8 | Method::GET => WasiMethod::Get, |
| 9 | Method::HEAD => WasiMethod::Head, |
| 10 | Method::POST => WasiMethod::Post, |
| 11 | Method::PUT => WasiMethod::Put, |
| 12 | Method::DELETE => WasiMethod::Delete, |
| 13 | Method::CONNECT => WasiMethod::Connect, |
| 14 | Method::OPTIONS => WasiMethod::Options, |
| 15 | Method::TRACE => WasiMethod::Trace, |
| 16 | Method::PATCH => WasiMethod::Patch, |
| 17 | other => WasiMethod::Other(other.as_str().to_owned()), |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | pub(crate) fn from_wasi_method(value: WasiMethod) -> Result<Method, InvalidMethod> { |
| 22 | Ok(match value { |