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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::FromRequestContextRefPair;
use crate::{dep::http::request::Parts, Method};
use rama_core::Context;
use std::convert::Infallible;

impl<S> FromRequestContextRefPair<S> for Method
where
    S: Clone + Send + Sync + 'static,
{
    type Rejection = Infallible;

    async fn from_request_context_ref_pair(
        _ctx: &Context<S>,
        parts: &Parts,
    ) -> Result<Self, Self::Rejection> {
        Ok(parts.method.clone())
    }
}