fn is_match(&self, state: &State) -> Result<(), RouteNonMatch> {
        match Headers::borrow_from(state).get::<ContentType>() {
            Some(content_type) => {
                if self.supported_media_types.contains(&content_type.0) {
                    return Ok(());
                }

                trace!(
                    "[{}] did not specify a Content-Type with a media type supported by this Route",
                    request_id(&state)
                );
                Err(RouteNonMatch::new(StatusCode::UnsupportedMediaType))
            }
            // The client has not specified a `Content-Type` header.
            None => Err(RouteNonMatch::new(StatusCode::UnsupportedMediaType)),
        }
    }
/// Determines if the `Request` was made using a `Content-Type` header that includes a
/// supported media type. A missing `Content-Type` header will not match.
Determines if the `Request` was made using a `Content-Type` header that includes a
supported media type. A missing `Content-Type` header will not match.
Determines if the ` Request ` was made using a ` Content - Type ` header that includes a supported media type . A missing ` Content - Type ` header will not match .
fn is_match(&self, state: &State) -> Result<(), RouteNonMatch> {
        match Headers::borrow_from(state).get::<ContentType>() {
            Some(content_type) => {
                if self.supported_media_types.contains(&content_type.0) {
                    return Ok(());
                }
                trace!(
                    "[{}] did not specify a Content-Type with a media type supported by this Route",
                    request_id(&state)
                );
                Err(RouteNonMatch::new(StatusCode::UnsupportedMediaType))
            }
            // The client has not specified a `Content-Type` header.
            None => Err(RouteNonMatch::new(StatusCode::UnsupportedMediaType)),
        }
    }
fn is_match ( & self , state : & State ) -> Result < ( ) , RouteNonMatch > { match Headers :: borrow_from ( state ) . get :: < ContentType > ( ) { Some ( content_type ) => { if self . supported_media_types . contains ( & content_type . 0 ) { return Ok ( ( ) ) ; } trace ! ( " " request_id ( state ) ) ; Err ( RouteNonMatch :: new ( StatusCode :: UnsupportedMediaType ) ) } // The client has not specified a `Content-Type` header. None => Err ( RouteNonMatch :: new ( StatusCode :: UnsupportedMediaType ) ) , } }
Determines if the `Request` was made using a `Content-Type` header that includes a
supported media type.
Determines if the ` Request ` was made using a ` Content - Type ` header that includes a supported media type .
&self
state
&State
&self
state
&State