//! Do NOT edit this code. //! It was automatically generated by Pavex. //! All manual edits will be lost next time the code is generated. extern crate alloc; struct ServerState { router: pavex_matchit::Router, #[allow(dead_code)] application_state: ApplicationState, } pub struct ApplicationState {} pub async fn build_application_state() -> crate::ApplicationState { crate::ApplicationState {} } pub fn run( server_builder: pavex::server::Server, application_state: ApplicationState, ) -> pavex::server::ServerHandle { let server_state = std::sync::Arc::new(ServerState { router: build_router(), application_state, }); server_builder.serve(route_request, server_state) } fn build_router() -> pavex_matchit::Router { let mut router = pavex_matchit::Router::new(); router.insert("/any", 0u32).unwrap(); router.insert("/any_w_extensions", 1u32).unwrap(); router.insert("/connect", 2u32).unwrap(); router.insert("/custom", 3u32).unwrap(); router.insert("/delete", 4u32).unwrap(); router.insert("/get", 5u32).unwrap(); router.insert("/head", 6u32).unwrap(); router.insert("/mixed", 7u32).unwrap(); router.insert("/mixed_with_custom", 8u32).unwrap(); router.insert("/options", 9u32).unwrap(); router.insert("/patch", 10u32).unwrap(); router.insert("/post", 11u32).unwrap(); router.insert("/put", 12u32).unwrap(); router.insert("/trace", 13u32).unwrap(); router } async fn route_request( request: http::Request, _connection_info: Option, server_state: std::sync::Arc, ) -> pavex::response::Response { let (request_head, request_body) = request.into_parts(); #[allow(unused)] let request_body = pavex::request::body::RawIncomingBody::from(request_body); let request_head: pavex::request::RequestHead = request_head.into(); let matched_route = match server_state.router.at(&request_head.target.path()) { Ok(m) => m, Err(_) => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter( vec![], ) .into(); return route_14::entrypoint(&allowed_methods).await; } }; let route_id = matched_route.value; #[allow(unused)] let url_params: pavex::request::path::RawPathParams<'_, '_> = matched_route .params .into(); match route_id { 0u32 => { match &request_head.method { &pavex::http::Method::CONNECT | &pavex::http::Method::DELETE | &pavex::http::Method::GET | &pavex::http::Method::HEAD | &pavex::http::Method::OPTIONS | &pavex::http::Method::PATCH | &pavex::http::Method::POST | &pavex::http::Method::PUT | &pavex::http::Method::TRACE => route_9::entrypoint().await, _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::CONNECT, pavex::http::Method::DELETE, pavex::http::Method::GET, pavex::http::Method::HEAD, pavex::http::Method::OPTIONS, pavex::http::Method::PATCH, pavex::http::Method::POST, pavex::http::Method::PUT, pavex::http::Method::TRACE, ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 1u32 => route_10::entrypoint().await, 2u32 => { match &request_head.method { &pavex::http::Method::CONNECT => route_0::entrypoint().await, _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::CONNECT, ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 3u32 => { match &request_head.method { s if s.as_str() == "CUSTOM" => route_12::entrypoint().await, _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::try_from("CUSTOM") .expect("CUSTOM is not a valid (custom) HTTP method"), ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 4u32 => { match &request_head.method { &pavex::http::Method::DELETE => route_1::entrypoint().await, _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::DELETE, ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 5u32 => { match &request_head.method { &pavex::http::Method::GET => route_2::entrypoint().await, _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::GET, ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 6u32 => { match &request_head.method { &pavex::http::Method::HEAD => route_3::entrypoint().await, _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::HEAD, ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 7u32 => { match &request_head.method { &pavex::http::Method::PATCH | &pavex::http::Method::POST => { route_11::entrypoint().await } _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::PATCH, pavex::http::Method::POST, ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 8u32 => { match &request_head.method { &pavex::http::Method::GET => route_13::entrypoint().await, s if s.as_str() == "CUSTOM" || s.as_str() == "HEY" => { route_13::entrypoint().await } _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::try_from("CUSTOM") .expect("CUSTOM is not a valid (custom) HTTP method"), pavex::http::Method::GET, pavex::http::Method::try_from("HEY") .expect("HEY is not a valid (custom) HTTP method"), ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 9u32 => { match &request_head.method { &pavex::http::Method::OPTIONS => route_4::entrypoint().await, _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::OPTIONS, ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 10u32 => { match &request_head.method { &pavex::http::Method::PATCH => route_5::entrypoint().await, _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::PATCH, ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 11u32 => { match &request_head.method { &pavex::http::Method::POST => route_6::entrypoint().await, _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::POST, ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 12u32 => { match &request_head.method { &pavex::http::Method::PUT => route_7::entrypoint().await, _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::PUT, ]) .into(); route_14::entrypoint(&allowed_methods).await } } } 13u32 => { match &request_head.method { &pavex::http::Method::TRACE => route_8::entrypoint().await, _ => { let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ pavex::http::Method::TRACE, ]) .into(); route_14::entrypoint(&allowed_methods).await } } } i => unreachable!("Unknown route id: {}", i), } } pub mod route_0 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_0::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_1 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_1::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_2 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_2::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_3 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_3::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_4 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_4::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_5 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_5::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_6 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_6::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_7 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_7::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_8 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_8::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_9 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_9::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_10 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_10::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_11 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_11::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_12 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_12::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_13 { pub async fn entrypoint() -> pavex::response::Response { let response = wrapping_0().await; response } async fn stage_1() -> pavex::response::Response { let response = handler().await; response } async fn wrapping_0() -> pavex::response::Response { let v0 = crate::route_13::Next0 { next: stage_1, }; let v1 = pavex::middleware::Next::new(v0); let v2 = pavex::middleware::wrap_noop(v1).await; ::into_response(v2) } async fn handler() -> pavex::response::Response { let v0 = app::handler(); ::into_response(v0) } struct Next0 where T: std::future::Future, { next: fn() -> T, } impl std::future::IntoFuture for Next0 where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)() } } } pub mod route_14 { pub async fn entrypoint<'a>( s_0: &'a pavex::router::AllowedMethods, ) -> pavex::response::Response { let response = wrapping_0(s_0).await; response } async fn stage_1<'a>( s_0: &'a pavex::router::AllowedMethods, ) -> pavex::response::Response { let response = handler(s_0).await; response } async fn wrapping_0( v0: &pavex::router::AllowedMethods, ) -> pavex::response::Response { let v1 = crate::route_14::Next0 { s_0: v0, next: stage_1, }; let v2 = pavex::middleware::Next::new(v1); let v3 = pavex::middleware::wrap_noop(v2).await; ::into_response(v3) } async fn handler(v0: &pavex::router::AllowedMethods) -> pavex::response::Response { let v1 = pavex::router::default_fallback(v0).await; ::into_response(v1) } struct Next0<'a, T> where T: std::future::Future, { s_0: &'a pavex::router::AllowedMethods, next: fn(&'a pavex::router::AllowedMethods) -> T, } impl<'a, T> std::future::IntoFuture for Next0<'a, T> where T: std::future::Future, { type Output = pavex::response::Response; type IntoFuture = T; fn into_future(self) -> Self::IntoFuture { (self.next)(self.s_0) } } }