rama_http/service/web/endpoint/extract/
method.rs

1use super::FromRequestContextRefPair;
2use crate::{Method, dep::http::request::Parts};
3use rama_core::Context;
4use std::convert::Infallible;
5
6impl<S> FromRequestContextRefPair<S> for Method
7where
8    S: Clone + Send + Sync + 'static,
9{
10    type Rejection = Infallible;
11
12    async fn from_request_context_ref_pair(
13        _ctx: &Context<S>,
14        parts: &Parts,
15    ) -> Result<Self, Self::Rejection> {
16        Ok(parts.method.clone())
17    }
18}