use pavex::blueprint::{constructor::Lifecycle, router::GET, Blueprint}; use pavex::f; pub struct A; pub struct B; pub struct C; pub struct D; pub struct E; pub trait MyTrait { fn a_method_that_returns_self() -> Self; fn a_method_that_borrows_self(&self) -> B; fn a_method_with_a_generic(&self) -> D; } pub trait AnotherTrait { fn a_method_that_consumes_self(self) -> C; } pub trait GenericTrait { fn a_method(&self) -> E; } impl MyTrait for A { fn a_method_that_returns_self() -> Self { todo!() } fn a_method_that_borrows_self(&self) -> B { todo!() } fn a_method_with_a_generic(&self) -> D { todo!() } } impl AnotherTrait for B { fn a_method_that_consumes_self(self) -> C { todo!() } } impl GenericTrait for C { fn a_method(&self) -> E { todo!() } } pub fn handler(_a: A, _c: C, _d: D, _e: E) -> pavex::response::Response { todo!() } pub fn blueprint() -> Blueprint { let mut bp = Blueprint::new(); bp.constructor( f!(::a_method_that_returns_self), Lifecycle::RequestScoped, ); bp.constructor( f!(::a_method_that_borrows_self), Lifecycle::RequestScoped, ); bp.constructor( f!(::a_method_with_a_generic::), Lifecycle::RequestScoped, ); bp.constructor( f!(::a_method_that_consumes_self), Lifecycle::RequestScoped, ); bp.constructor( f!(>::a_method), Lifecycle::RequestScoped, ); bp.route(GET, "/home", f!(crate::handler)); bp }