pub async fn list_tickets(&self, _ctx: Ctx) -> Result<Vec<Ticket>, TicketError> {
let store = self.tickets_store.lock().await;
let tickets = store.iter().filter_map(|t| t.clone()).collect();
Ok(tickets)
}
I expected to see this happen:
I expected no change in the tests/running of the example since the context isn't used in the downstream handler logic.
Instead, this happened:
Application fails to build and panics during codegen.
Error
cargo px check:
Computing package graph
Computed package graph in 0.102s
Compiling `bp`, the code generator for `server_sdk`
warning: /home/snarkipus/Projects/rust-edu/Pavex/chone/workspace_hack/Cargo.toml: no edition set: defaulting to the 2015 edition while the latest is 2021
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s
Compiled `bp`, the code generator for `server_sdk`, in 0.062s
Generating `server_sdk`
warning: /home/snarkipus/Projects/rust-edu/Pavex/chone/workspace_hack/Cargo.toml: no edition set: defaulting to the 2015 edition while the latest is 2021
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s
Running `target/debug/bp`
Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
Run with RUST_BACKTRACE=full to include source snippets.
The application panicked (crashed).
Could not find a binding for input type `app::ctx::Ctx` in the input bindings.
Input bindings:
- s_0: &pavex::request::RequestHead,
- s_1: &biscotti::Processor,
- s_2: &app::configuration::ModelController,
- s_3: pavex::request::path::MatchedPathPattern,
in pavexc/src/compiler/analyses/processing_pipeline/codegen.rs, line 108
thread: main
The invocation of `pavex [...] generate [...]` exited with a non-zero status code: 101
error: Failed to run `bp`, the code generator for package `server_sdk`
```zsh
Backtrace (most recent call first):
File "", line 0, in pavexc::compiler::analyses::processing_pipeline::codegen::::codegen
File "", line 0, in as alloc::vec::spec_from_iter::SpecFromIter>::from_iter
File "", line 0, in as core::iter::traits::collect::FromIterator<(K,V)>>::from_iter
File "", line 0, in pavexc::compiler::codegen::codegen_app
File "", line 0, in pavexc::compiler::app::App::codegen
File "", line 0, in pavexc::main
File "", line 0, in std::sys_common::backtrace::__rust_begin_short_backtrace
File "", line 0, in std::rt::lang_start::{{closure}}
File "", line 0, in std::rt::lang_start_internal
File "", line 0, in main
File "./csu/../sysdeps/nptl/libc_start_call_main.h", line 58, in __libc_start_call_main
File "./csu/../csu/libc-start.c", line 360, in __libc_start_main_impl
File "", line 0, in _start
```
Not sure if it helps, but I can see the following in the codegen output:
Pre-processing codegen picks it up the context: link
I tried this code: repo
Registered a constructor & fallible pre-processor middleware: link
Passed a mutable reference to the middleware (note: this works): link
Access the context in a subsequent hander (note: this breaks):
I expected to see this happen: I expected no change in the tests/running of the example since the context isn't used in the downstream handler logic.
Instead, this happened: Application fails to build and panics during codegen.
Error
cargo px check
:Meta
pavex --version
:rustc --version --verbose
:Backtrace
```zsh Backtrace (most recent call first): File "", line 0, in pavexc::compiler::analyses::processing_pipeline::codegen::::codegen
File "", line 0, in as alloc::vec::spec_from_iter::SpecFromIter>::from_iter
File "", line 0, in as core::iter::traits::collect::FromIterator<(K,V)>>::from_iter
File "", line 0, in pavexc::compiler::codegen::codegen_app
File "", line 0, in pavexc::compiler::app::App::codegen
File "", line 0, in pavexc::main
File "", line 0, in std::sys_common::backtrace::__rust_begin_short_backtrace
File "", line 0, in std::rt::lang_start::{{closure}}
File "", line 0, in std::rt::lang_start_internal
File "", line 0, in main
File "./csu/../sysdeps/nptl/libc_start_call_main.h", line 58, in __libc_start_call_main
File "./csu/../csu/libc-start.c", line 360, in __libc_start_main_impl
File "", line 0, in _start
```
Not sure if it helps, but I can see the following in the codegen output:
Pre-processing codegen picks it up the context: link
Handler codegen does not (error): link