From 3941d6957072db1ea0429066cb172544721c14dd Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:33:30 +0200 Subject: [PATCH 01/16] Update deps --- libs/Cargo.lock | 109 +++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 62 deletions(-) diff --git a/libs/Cargo.lock b/libs/Cargo.lock index 7c9787bca..feacc3d27 100644 --- a/libs/Cargo.lock +++ b/libs/Cargo.lock @@ -4,19 +4,13 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -156,9 +150,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" [[package]] name = "anymap2" @@ -215,17 +209,17 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -431,9 +425,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.15" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" dependencies = [ "jobserver", "libc", @@ -486,9 +480,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.16" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -505,9 +499,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", @@ -615,9 +609,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -928,7 +922,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -1115,9 +1109,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "glob" @@ -1127,9 +1121,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ "aho-corasick", "bstr", @@ -1346,9 +1340,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http", @@ -1423,9 +1417,9 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.22" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" +checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" dependencies = [ "crossbeam-deque", "globset", @@ -1491,9 +1485,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.39.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" +checksum = "6593a41c7a73841868772495db7dc1e8ecab43bb5c0b6da2059246c4b506ab60" dependencies = [ "console", "lazy_static", @@ -1515,9 +1509,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "is_ci" @@ -1837,15 +1831,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.8.0" @@ -2477,9 +2462,9 @@ dependencies = [ [[package]] name = "pest" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" dependencies = [ "memchr", "thiserror", @@ -2488,9 +2473,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" +checksum = "664d22978e2815783adbdd2c588b455b1bd625299ce36b2a99881ac9627e6d8d" dependencies = [ "pest", "pest_generator", @@ -2498,9 +2483,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" +checksum = "a2d5487022d5d33f4c30d91c22afa240ce2a644e87fe08caad974d4eab6badbe" dependencies = [ "pest", "pest_meta", @@ -2511,9 +2496,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" +checksum = "0091754bbd0ea592c4deb3a122ce8ecbb0753b738aa82bc055fcc2eccc8d8174" dependencies = [ "once_cell", "pest", @@ -3108,9 +3093,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.35" +version = "0.38.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" +checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" dependencies = [ "bitflags 2.6.0", "errno", @@ -3229,18 +3214,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -3262,9 +3247,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.127" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", "memchr", @@ -3708,9 +3693,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", From 769b04342a05f12213a298159f7aa9ff6bab7464 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:36:54 +0200 Subject: [PATCH 02/16] Working copy --- .gitignore | 3 +- libs/Cargo.lock | 30 +- libs/pavex_cli/Cargo.toml | 2 +- libs/pavex_cli/tests/ui_tests.rs | 2 +- .../dep_1.rs | 12 - .../dep_2.rs | 12 - .../expectations/stderr.txt | 13 - .../lib.rs | 14 - .../test_config.toml | 13 - libs/pavex_test_runner2/Cargo.toml | 36 + libs/pavex_test_runner2/src/lib.rs | 856 ++++++++++++++++++ libs/pavex_test_runner2/src/snapshot.rs | 151 +++ .../src/target_directory.rs | 62 ++ 13 files changed, 1138 insertions(+), 68 deletions(-) delete mode 100644 libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/dep_1.rs delete mode 100644 libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/dep_2.rs delete mode 100644 libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/expectations/stderr.txt delete mode 100644 libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/lib.rs delete mode 100644 libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/test_config.toml create mode 100644 libs/pavex_test_runner2/Cargo.toml create mode 100644 libs/pavex_test_runner2/src/lib.rs create mode 100644 libs/pavex_test_runner2/src/snapshot.rs create mode 100644 libs/pavex_test_runner2/src/target_directory.rs diff --git a/.gitignore b/.gitignore index 22fca860d..babe2434f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /libs/ui_test_envs +/libs/ui_test_envs2 /libs/target /libs/vendor /libs/.cargo @@ -14,4 +15,4 @@ trace-*.json /.cache/ /docs/api_reference/ -.direnv/ \ No newline at end of file +.direnv/ diff --git a/libs/Cargo.lock b/libs/Cargo.lock index feacc3d27..24ea2cdca 100644 --- a/libs/Cargo.lock +++ b/libs/Cargo.lock @@ -2165,7 +2165,7 @@ dependencies = [ "owo-colors", "pavex_cli_deps", "pavex_miette", - "pavex_test_runner", + "pavex_test_runner2", "pavexc", "pavexc_cli_client", "pem", @@ -2320,6 +2320,34 @@ dependencies = [ "walkdir", ] +[[package]] +name = "pavex_test_runner2" +version = "0.1.48" +dependencies = [ + "ahash", + "anyhow", + "console", + "fs-err", + "globwalk", + "itertools 0.12.1", + "libtest-mimic", + "miette", + "num_cpus", + "object-pool", + "once_cell", + "persist_if_changed", + "px_workspace_hack", + "regex", + "serde", + "serde_json", + "sha2", + "similar", + "textwrap", + "toml", + "tracing-subscriber", + "walkdir", +] + [[package]] name = "pavex_tracing" version = "0.1.48" diff --git a/libs/pavex_cli/Cargo.toml b/libs/pavex_cli/Cargo.toml index 355f21fa3..f889d1d0a 100644 --- a/libs/pavex_cli/Cargo.toml +++ b/libs/pavex_cli/Cargo.toml @@ -68,6 +68,6 @@ time = { workspace = true } px_workspace_hack = { version = "0.1", path = "../px_workspace_hack" } [dev-dependencies] -pavex_test_runner = { path = "../pavex_test_runner" } +pavex_test_runner = { path = "../pavex_test_runner2", package = "pavex_test_runner2" } # Enable more expensive debug assertions when building for testing purposes pavexc = { path = "../pavexc", features = ["debug_assertions"] } diff --git a/libs/pavex_cli/tests/ui_tests.rs b/libs/pavex_cli/tests/ui_tests.rs index 9ae319f60..1e4694f84 100644 --- a/libs/pavex_cli/tests/ui_tests.rs +++ b/libs/pavex_cli/tests/ui_tests.rs @@ -5,7 +5,7 @@ use std::str::FromStr; fn main() -> Result<(), Box> { let manifest_dir = PathBuf::from_str(env!("CARGO_MANIFEST_DIR")).unwrap(); let test_data_folder = manifest_dir.join("tests").join("ui_tests"); - let test_runtime_folder = manifest_dir.parent().unwrap().join("ui_test_envs"); + let test_runtime_folder = manifest_dir.parent().unwrap().join("ui_test_envs2"); let pavex_cli_path = get_pavex_cli_path()?; let pavexc_cli_path = get_pavexc_cli_path()?; run_tests( diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/dep_1.rs b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/dep_1.rs deleted file mode 100644 index 88cdd832c..000000000 --- a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/dep_1.rs +++ /dev/null @@ -1,12 +0,0 @@ -use pavex::blueprint::{constructor::Lifecycle, Blueprint}; -use pavex::f; - -pub struct Logger; - -pub fn new_logger() -> Logger { - todo!() -} - -pub fn add_logger(bp: &mut Blueprint) { - bp.constructor(f!(crate::new_logger), Lifecycle::Transient); -} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/dep_2.rs b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/dep_2.rs deleted file mode 100644 index 88cdd832c..000000000 --- a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/dep_2.rs +++ /dev/null @@ -1,12 +0,0 @@ -use pavex::blueprint::{constructor::Lifecycle, Blueprint}; -use pavex::f; - -pub struct Logger; - -pub fn new_logger() -> Logger { - todo!() -} - -pub fn add_logger(bp: &mut Blueprint) { - bp.constructor(f!(crate::new_logger), Lifecycle::Transient); -} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/expectations/stderr.txt deleted file mode 100644 index 539609131..000000000 --- a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/expectations/stderr.txt +++ /dev/null @@ -1,13 +0,0 @@ -ERROR: - Γ— `new_logger` is not a fully-qualified import path. - β”‚ - β”‚ ╭─[src/lib.rs:9:1] - β”‚  9 β”‚ let mut bp = Blueprint::new(); - β”‚ 10 β”‚ bp.constructor(f!(new_logger), Lifecycle::Singleton); - β”‚ Β·  ───────┬────── - β”‚ Β· ╰── The relative import path was registered here - β”‚ 11 β”‚ bp.route(GET, "/home", f!(crate::handler)); - β”‚ ╰──── - β”‚  help: If it is a local import, the path must start with `crate::`. - β”‚ If it is an import from a dependency, the path must start with the - β”‚ dependency name (e.g. `dependency::`). \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/lib.rs b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/lib.rs deleted file mode 100644 index 1551eaf32..000000000 --- a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/lib.rs +++ /dev/null @@ -1,14 +0,0 @@ -use pavex::blueprint::{constructor::Lifecycle, router::GET, Blueprint}; -use pavex::f; - -pub fn handler(_logger: dep_1::Logger, _logger_2: dep_2::Logger) -> pavex::response::Response { - todo!() -} - -pub fn blueprint() -> Blueprint { - let mut bp = Blueprint::new(); - dep_1::add_logger(&mut bp); - dep_2::add_logger(&mut bp); - bp.route(GET, "/home", f!(crate::handler)); - bp -} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/test_config.toml b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/test_config.toml deleted file mode 100644 index f751e4d3c..000000000 --- a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/test_config.toml +++ /dev/null @@ -1,13 +0,0 @@ -description = "pavex can resolve fully-qualified paths from a dependency crate that start with `crate::`" - -ignore = true - -[expectations] -codegen = "pass" - -[ephemeral_dependencies] -dep_1 = { path = "dep_1.rs", package = "dep", version = "1.0.0" } -dep_2 = { path = "dep_2.rs", package = "dep", version = "2.0.0" } - - - diff --git a/libs/pavex_test_runner2/Cargo.toml b/libs/pavex_test_runner2/Cargo.toml new file mode 100644 index 000000000..4f205b4bc --- /dev/null +++ b/libs/pavex_test_runner2/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "pavex_test_runner2" +version.workspace = true +description = "A custom test runner to execute UI tests for Pavex" +keywords = ["pavex"] +edition.workspace = true +repository.workspace = true +license.workspace = true +publish = false + +[package.metadata.dist] +dist = false + +[dependencies] +anyhow = { workspace = true } +ahash = { workspace = true } +console = { workspace = true } +fs-err = { workspace = true } +libtest-mimic = { workspace = true } +serde = { workspace = true, features = ["derive"] } +similar = { workspace = true, features = ["inline"] } +textwrap = { workspace = true } +toml = { workspace = true, features = ["preserve_order"] } +miette = { workspace = true, features = ["fancy"] } +walkdir = { workspace = true } +serde_json = { workspace = true } +itertools = { workspace = true } +sha2 = { workspace = true } +persist_if_changed = { path = "../persist_if_changed", version = "0.1.48" } +object-pool = { workspace = true } +num_cpus = { workspace = true } +globwalk = { workspace = true } +tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] } +regex = { workspace = true } +once_cell = { workspace = true } +px_workspace_hack = { version = "0.1", path = "../px_workspace_hack" } diff --git a/libs/pavex_test_runner2/src/lib.rs b/libs/pavex_test_runner2/src/lib.rs new file mode 100644 index 000000000..b79fa8662 --- /dev/null +++ b/libs/pavex_test_runner2/src/lib.rs @@ -0,0 +1,856 @@ +use std::collections::BTreeMap; +use std::fmt::Write; +use std::path::{Component, Path, PathBuf}; +use std::process::{Command, Output}; + +use ahash::HashMap; +use anyhow::Context; +use console::style; +use itertools::Itertools; +use libtest_mimic::{Conclusion, Failed}; +use sha2::Digest; +use toml::toml; +use walkdir::WalkDir; + +use persist_if_changed::{copy_if_changed, persist_if_changed}; +pub use snapshot::print_changeset; + +use crate::snapshot::SnapshotTest; + +mod snapshot; +mod target_directory; + +/// Return an iterator over the directories containing a UI test. +pub fn get_ui_test_directories(test_folder: &Path) -> impl Iterator { + WalkDir::new(test_folder) + .into_iter() + .filter_map(|entry| entry.ok()) + .filter(|entry| entry.file_name() == "test_config.toml") + .map(|entry| entry.path().parent().unwrap().to_path_buf()) +} + +/// Create a test case for each folder in `definition_directory`. +/// +/// Each test will get a separate runtime environmentβ€”a sub-folder of `runtime_directory`. The +/// same sub-folder is reused across multiple test runs to benefit from cargo's incremental compilation. +/// +/// Custom configuration can be specified on a per-test basis by including a `test_config.toml` file +/// in the test folder. The available test options are detailed in `TestConfig`. +/// +/// # cargo-nextest +/// +/// Our custom test runner is built on top of `libtest_mimic`, which gives us +/// [compatibility out-of-the-box](https://nexte.st/book/custom-test-harnesses.html) with `cargo-nextest`. +pub fn run_tests( + pavex_cli: PathBuf, + pavexc_cli: PathBuf, + definition_directory: PathBuf, + runtime_directory: PathBuf, +) -> Result { + let arguments = libtest_mimic::Arguments::from_args(); + + let mut test_name2test_data = BTreeMap::new(); + for entry in get_ui_test_directories(&definition_directory) { + let relative_path = entry.strip_prefix(&definition_directory).unwrap(); + let test_name = relative_path + .components() + .map(|c| { + let Component::Normal(c) = c else { + panic!("Expected a normal component") + }; + c.to_string_lossy() + }) + .join("::"); + let test_data = TestData::new( + &test_name, + entry.clone(), + runtime_directory.join(relative_path), + )?; + test_name2test_data.insert(test_name, test_data); + } + + create_tests_dir(&runtime_directory, &test_name2test_data, &pavex_cli)?; + + if !arguments.list { + warm_up_target_dir(&runtime_directory)?; + } + + let mut tests = Vec::new(); + for (name, data) in test_name2test_data { + let pavexc_cli = pavexc_cli.clone(); + let runtime_directory = runtime_directory.clone(); + let ignored = data.configuration.ignore; + let test = + libtest_mimic::Trial::test(name, move || run_test(runtime_directory, data, pavexc_cli)) + .with_ignored_flag(ignored); + tests.push(test); + } + Ok(libtest_mimic::run(&arguments, tests)) +} + +/// Compile all binary targets of the type `app_*`. +/// This ensures that all dependencies have been compiled, speeding up further operations, +/// as well as preparing the binaries that each test will invoke. +fn warm_up_target_dir(runtime_directory: &Path) -> Result<(), anyhow::Error> { + println!("Creating a workspace-hack crate to unify dependencies"); + + // Clean up pre-existing workspace_hack, since `cargo hakari init` will fail + // if it already exists. + let _ = fs_err::remove_dir_all(runtime_directory.join("workspace_hack")); + let _ = fs_err::remove_file(runtime_directory.join(".config").join("hakari.toml")); + + let mut cmd = Command::new("cargo"); + cmd.arg("hakari") + .arg("init") + .arg("-y") + .arg("workspace_hack") + .current_dir(runtime_directory) + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()); + let status = cmd.status()?; + if !status.success() { + anyhow::bail!("Failed to create workspace_hack crate"); + } + + let mut cmd = Command::new("cargo"); + cmd.arg("hakari") + .arg("generate") + .current_dir(runtime_directory) + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()); + let status = cmd.status()?; + if !status.success() { + anyhow::bail!("Failed to generate workspace_hack crate"); + } + + let mut cmd = Command::new("cargo"); + cmd.arg("hakari") + .arg("manage-deps") + .arg("-y") + .current_dir(runtime_directory) + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()); + let status = cmd.status()?; + if !status.success() { + anyhow::bail!("Failed to manage workspace_hack dependencies"); + } + + println!("Warming up the target directory"); + let mut cmd = Command::new("cargo"); + cmd.arg("build") + .arg("--bins") + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()) + .current_dir(runtime_directory); + let status = cmd.status()?; + if !status.success() { + anyhow::bail!("Failed to compile the test binaries"); + } + Ok(()) +} + +fn create_tests_dir( + runtime_directory: &Path, + test_name2test_data: &BTreeMap, + pavex_cli: &Path, +) -> Result<(), anyhow::Error> { + let timer = std::time::Instant::now(); + println!("Seeding the filesystem"); + fs_err::create_dir_all(&runtime_directory) + .context("Failed to create runtime directory for UI tests")?; + + // Create a `Cargo.toml` to define a workspace, + // where each UI test is a workspace member + let cargo_toml_path = runtime_directory.join("Cargo.toml"); + let mut cargo_toml = String::new(); + writeln!(&mut cargo_toml, "[workspace]\nmembers = [").unwrap(); + for test_data in test_name2test_data.values() { + for member in test_data.workspace_members() { + let relative_path = member.strip_prefix(&runtime_directory).unwrap(); + writeln!(cargo_toml, " \"{}\",", relative_path.display()).unwrap(); + } + } + writeln!(&mut cargo_toml, "]").unwrap(); + writeln!(&mut cargo_toml, "resolver = \"2\"").unwrap(); + writeln!(&mut cargo_toml, "[workspace.dependencies]").unwrap(); + writeln!(&mut cargo_toml, "pavex = {{ path = \"../pavex\" }}").unwrap(); + writeln!( + &mut cargo_toml, + "pavex_cli_client = {{ path = \"../pavex_cli_client\" }}" + ) + .unwrap(); + writeln!(&mut cargo_toml, "tokio = \"1\"").unwrap(); + writeln!(&mut cargo_toml, "reqwest = \"0.12\"").unwrap(); + + persist_if_changed(&cargo_toml_path, cargo_toml.as_bytes())?; + + // Create a manifest for each UI test + // Each UI test is composed of multiple crates, therefore we nest + // everything under a test-specific directory to avoid name + // clashes and confusion across tests + for test_data in test_name2test_data.values() { + test_data.seed_test_filesystem(pavex_cli)?; + } + + println!( + "Seeded the filesystem in {:?}ms", + timer.elapsed().as_millis() + ); + + Ok(()) +} + +#[derive(serde::Deserialize)] +#[serde(rename_all = "snake_case")] +/// Configuration values that can be specified next to the test data to influence how it's going +/// to be executed. +struct TestConfig { + /// A short description explaining what the test is about, primarily for documentation purposes. + /// It will be shown in the terminal if the test fails. + description: String, + /// Define what we expect to see when running the tests (e.g. should code generation succeed or fail?). + #[serde(default)] + expectations: TestExpectations, + /// Ephemeral crates that should be generated as part of the test setup in order to be + /// used as dependencies of the main crate under test. + #[serde(default)] + ephemeral_dependencies: HashMap, + /// Crates that should be listed as dependencies of the package under the test, in addition to + /// Pavex itself. + #[serde(default)] + dependencies: toml::value::Table, + /// Crates that should be listed as dev dependencies of the test package. + #[serde(default, rename = "dev-dependencies")] + dev_dependencies: toml::value::Table, + /// Ignore the test if set to `true`. + #[serde(default)] + ignore: bool, +} + +#[derive(serde::Deserialize)] +#[serde(rename_all = "snake_case")] +struct EphemeralDependency { + #[serde(default)] + /// The name of the package in the generated `Cargo.toml`. + /// If not specified, the corresponding key in [`TestConfig::ephemeral_dependencies`] will be used. + package: Option, + /// The path to the file that should be used as `lib.rs` in the generated library crate. + path: PathBuf, + /// Crates that should be listed as dependencies of generated library crate. + #[serde(default)] + dependencies: toml::value::Table, + #[serde(default = "default_ephemeral_version")] + /// The version of the package in the generated `Cargo.toml`. + /// If not specified, it defaults to `0.1.0`. + version: String, +} + +fn default_ephemeral_version() -> String { + "0.1.0".to_string() +} + +#[derive(serde::Deserialize)] +#[serde(rename_all = "snake_case")] +struct TestExpectations { + /// By default, we expect code generation (i.e. `app.build()`) to succeed. + /// If set to `fail`, the test runner will look for a snapshot of the expected failure message + /// returned by Pavex to the user. + #[serde(default = "ExpectedOutcome::pass")] + codegen: ExpectedOutcome, + #[serde(default = "ExpectedOutcome::pass")] + lints: ExpectedOutcome, +} + +impl Default for TestExpectations { + fn default() -> Self { + Self { + codegen: ExpectedOutcome::Pass, + lints: ExpectedOutcome::Pass, + } + } +} + +#[derive(serde::Deserialize, PartialEq, Eq)] +#[serde(rename_all = "snake_case")] +enum ExpectedOutcome { + Pass, + Fail, +} + +impl ExpectedOutcome { + fn pass() -> ExpectedOutcome { + ExpectedOutcome::Pass + } +} + +/// Auxiliary data attached to each test definition for convenient retrieval. +/// It's used in [`run_test`]. +struct TestData { + name_hash: String, + definition_directory: PathBuf, + runtime_directory: PathBuf, + configuration: TestConfig, + has_tests: bool, +} + +impl TestData { + fn new( + test_name: &str, + definition_directory: PathBuf, + runtime_directory: PathBuf, + ) -> Result { + let name_hash = { + let mut hasher = sha2::Sha256::default(); + <_ as sha2::Digest>::update(&mut hasher, test_name.as_bytes()); + let full_hash = hasher.finalize(); + // Get the first 8 hex characters of the hash, they should be enough to identify the test + let mut hash = String::new(); + for byte in full_hash.iter().take(4) { + write!(&mut hash, "{:02x}", byte).unwrap(); + } + hash + }; + let configuration = Self::load_configuration(&definition_directory)?; + let integration_test_file = definition_directory.join("test.rs"); + let has_tests = integration_test_file.exists(); + Ok(Self { + name_hash, + definition_directory, + configuration, + runtime_directory, + has_tests, + }) + } + + fn workspace_members(&self) -> Vec { + let mut members = vec![ + self.blueprint_directory().to_path_buf(), + self.generated_app_directory(), + ]; + if let Some(dir) = self.integration_test_directory() { + members.push(dir.to_path_buf()); + } + members + } + + fn load_configuration(definition_directory: &Path) -> Result { + let path = definition_directory.join("test_config.toml"); + let test_config = fs_err::read_to_string(&path).context( + "All UI tests must have an associated `test_config.toml` file with, \ + at the very least, a `description` field explaining what the test is trying \ + to verify.", + )?; + toml::from_str(&test_config).with_context(|| { + format!( + "Failed to deserialize {:?}. Check the file against the expected schema!", + &path + ) + }) + } + + /// The directory containing the source code of all ephemeral dependencies. + /// + /// We don't want to list ephemeral dependencies as members of the workspace of the project under test + /// in order to be able to have multiple versions of the same crate as dependencies of the project under test. + /// That would be forbidden by `cargo` if they were listed as members of the same workspace. + fn ephemeral_deps_runtime_directory(&self) -> PathBuf { + self.runtime_directory.join("ephemeral_deps") + } + + fn blueprint_directory(&self) -> &Path { + &self.runtime_directory + } + + fn generated_app_directory(&self) -> PathBuf { + self.runtime_directory.join("generated_app") + } + + fn integration_test_directory(&self) -> Option { + self.has_tests + .then(|| self.runtime_directory.join("integration")) + } + + /// Populate the runtime test folder using the directives and the files in the test + /// definition folder. + fn seed_test_filesystem(&self, pavex_cli: &Path) -> Result<(), anyhow::Error> { + fs_err::create_dir_all(&self.runtime_directory) + .context("Failed to create runtime directory for UI test")?; + let source_directory = self.runtime_directory.join("src"); + fs_err::create_dir_all(&source_directory).context( + "Failed to create the runtime directory for the project under test when setting up the test runtime environment", + )?; + copy_if_changed( + &self.definition_directory.join("lib.rs"), + &source_directory.join("lib.rs"), + )?; + + let deps_subdir = self.ephemeral_deps_runtime_directory(); + fs_err::create_dir_all(&source_directory).context( + "Failed to create the runtime directory for ephemeral dependencies when setting up the test runtime environment", + )?; + + for (dependency_name, dependency_config) in &self.configuration.ephemeral_dependencies { + let dep_runtime_directory = deps_subdir.join(dependency_name); + let package_name = dependency_config + .package + .clone() + .unwrap_or(dependency_name.to_owned()); + let dep_source_directory = dep_runtime_directory.join("src"); + fs_err::create_dir_all(&dep_source_directory).context( + "Failed to create the source directory for an ephemeral dependency when setting up the test runtime environment", + )?; + + copy_if_changed( + &self.definition_directory.join(&dependency_config.path), + &dep_source_directory.join("lib.rs"), + )?; + + let mut cargo_toml = toml! { + [package] + name = "dummy" + version = "0.1.0" + edition = "2021" + + [lints.rust] + unexpected_cfgs = { level = "allow", check-cfg = ["cfg(pavex_ide_hint)"] } + + [dependencies] + pavex = { workspace = true } + }; + cargo_toml["package"]["name"] = format!("{package_name}_{}", self.name_hash).into(); + cargo_toml["package"]["version"] = dependency_config.version.clone().into(); + let deps = cargo_toml + .get_mut("dependencies") + .unwrap() + .as_table_mut() + .unwrap(); + deps.extend(dependency_config.dependencies.clone()); + + persist_if_changed( + &dep_runtime_directory.join("Cargo.toml"), + toml::to_string(&cargo_toml)?.as_bytes(), + )?; + } + + if let Some(integration_test_directory) = self.integration_test_directory() { + let integration_test_file = self.definition_directory.join("test.rs"); + let integration_test_src_directory = integration_test_directory.join("src"); + let integration_test_test_directory = integration_test_directory.join("tests"); + fs_err::create_dir_all(&integration_test_src_directory).context( + "Failed to create the runtime directory for integration tests when setting up the test runtime environment", + )?; + fs_err::create_dir_all(&integration_test_test_directory).context( + "Failed to create the runtime directory for integration tests when setting up the test runtime environment", + )?; + copy_if_changed( + &integration_test_file, + &integration_test_test_directory.join("run.rs"), + )?; + persist_if_changed(&integration_test_src_directory.join("lib.rs"), b"")?; + + let mut cargo_toml = toml! { + [package] + name = "dummy" + version = "0.1.0" + edition = "2021" + + [dependencies] + application = { path = "../generated_app" } + app = { path = ".." } + + [dev-dependencies] + tokio = { workspace = true, features = ["full"] } + reqwest = { workspace = true } + pavex = { workspace = true } + }; + cargo_toml["package"]["name"] = format!("integration_{}", self.name_hash).into(); + cargo_toml["dependencies"]["application"] + .as_table_mut() + .unwrap() + .insert( + "package".into(), + format!("application_{}", self.name_hash).into(), + ); + cargo_toml["dependencies"]["app"] + .as_table_mut() + .unwrap() + .insert("package".into(), format!("app_{}", self.name_hash).into()); + + let dev_deps = cargo_toml + .get_mut("dev-dependencies") + .unwrap() + .as_table_mut() + .unwrap(); + dev_deps.extend(self.configuration.dev_dependencies.clone()); + + persist_if_changed( + &integration_test_directory.join("Cargo.toml"), + toml::to_string(&cargo_toml)?.as_bytes(), + )?; + } + + // Generated application crate, ahead of code generation. + { + let application_dir = self.generated_app_directory(); + let application_src_dir = application_dir.join("src"); + fs_err::create_dir_all(&application_src_dir).context( + "Failed to create the runtime directory for the generated application when setting up the test runtime environment", + )?; + persist_if_changed(&application_src_dir.join("lib.rs"), b"")?; + + let mut cargo_toml = toml! { + [package] + name = "dummy" + version = "0.1.0" + edition = "2021" + + [package.metadata.px.generate] + generator_type = "cargo_workspace_binary" + generator_name = "app" + }; + cargo_toml["package"]["name"] = format!("application_{}", self.name_hash).into(); + persist_if_changed( + &application_dir.join("Cargo.toml"), + toml::to_string(&cargo_toml)?.as_bytes(), + )?; + } + + let mut cargo_toml = toml! { + [package] + name = "dummy" + version = "0.1.0" + edition = "2021" + + [lints.rust] + unexpected_cfgs = { level = "allow", check-cfg = ["cfg(pavex_ide_hint)"] } + + [dependencies] + pavex = { workspace = true } + pavex_cli_client = { workspace = true } + }; + cargo_toml["package"]["name"] = format!("app_{}", self.name_hash).into(); + let deps = cargo_toml + .get_mut("dependencies") + .unwrap() + .as_table_mut() + .unwrap(); + deps.extend(self.configuration.dependencies.clone()); + let ephemeral_dependencies = + self.configuration + .ephemeral_dependencies + .iter() + .map(|(key, config)| { + let mut value = toml::value::Table::new(); + value.insert("path".into(), format!("ephemeral_deps/{key}").into()); + let package_name = if let Some(package_name) = config.package.as_ref() { + package_name.to_owned() + } else { + key.to_owned() + }; + value.insert( + "package".into(), + format!("{package_name}_{}", self.name_hash).into(), + ); + (key.to_owned(), toml::Value::Table(value)) + }); + deps.extend(ephemeral_dependencies); + + persist_if_changed( + &self.runtime_directory.join("Cargo.toml"), + toml::to_string(&cargo_toml)?.as_bytes(), + )?; + + let main_rs = format!( + r##"use app_{}::blueprint; +use pavex_cli_client::{{Client, config::Color}}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> {{ + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(r#"{}"#.into()) + .generate(blueprint(), "generated_app".into()) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome {{ + Ok(_) => {{}}, + Err(GenerateError::NonZeroExitCode(_)) => {{ std::process::exit(1); }} + Err(e) => {{ + eprintln!("Failed to invoke `pavex generate`.\n{{:?}}", e); + std::process::exit(1); + }} + }} + Ok(()) +}} +"##, + self.name_hash, + pavex_cli.to_str().unwrap() + ); + persist_if_changed(&source_directory.join("main.rs"), main_rs.as_bytes())?; + Ok(()) + } + + pub fn should_run_tests(&self) -> ShouldRunTests { + if self.has_tests { + ShouldRunTests::Yes + } else { + ShouldRunTests::No + } + } +} + +enum ShouldRunTests { + Yes, + No, +} + +fn run_test(runtime_directory: PathBuf, test: TestData, pavexc_cli: PathBuf) -> Result<(), Failed> { + match _run_test(&runtime_directory, &test, &pavexc_cli) { + Ok(TestOutcome { + outcome: Err(mut msg), + codegen_output, + compilation_output, + test_output, + }) => Err(Failed::from({ + write!( + &mut msg, + "\n\nCODEGEN:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", + codegen_output.stdout, codegen_output.stderr + ) + .unwrap(); + if let Some(compilation_output) = compilation_output { + write!( + &mut msg, + "\n\nCARGO CHECK:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", + compilation_output.stdout, compilation_output.stderr + ) + .unwrap(); + } + if let Some(test_output) = test_output { + write!( + &mut msg, + "\n\nCARGO TEST:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", + test_output.stdout, test_output.stderr + ) + .unwrap(); + } + enrich_failure_message(&test.configuration, msg) + })), + Err(e) => Err(Failed::from(enrich_failure_message( + &test.configuration, + unexpected_failure_message(&e), + ))), + Ok(TestOutcome { + outcome: Ok(()), .. + }) => Ok(()), + } +} + +fn _run_test( + runtime_directory: &Path, + test: &TestData, + pavexc_cli: &Path, +) -> Result { + let binary_name = format!("app_{}", test.name_hash); + let timer = std::time::Instant::now(); + println!("Running {binary_name}"); + let binary = runtime_directory + .join("target") + .join("debug") + .join(&binary_name); + let output = std::process::Command::new(binary) + .env("PAVEX_PAVEXC", pavexc_cli) + .env("PAVEXC_LOG", "true") + .current_dir(&test.runtime_directory) + .stderr(std::process::Stdio::inherit()) + .stdout(std::process::Stdio::inherit()) + .output() + .context("Failed to perform code generation")?; + println!("Ran {binary_name} in {} seconds", timer.elapsed().as_secs()); + + let codegen_output: CommandOutput = (&output).try_into()?; + + let expectations_directory = test.definition_directory.join("expectations"); + + if !output.status.success() { + return match test.configuration.expectations.codegen { + ExpectedOutcome::Pass => Ok(TestOutcome { + outcome: Err("We failed to generate the application code.".to_string()), + codegen_output, + compilation_output: None, + test_output: None, + }), + ExpectedOutcome::Fail => { + let stderr_snapshot = SnapshotTest::new(expectations_directory.join("stderr.txt")); + if stderr_snapshot.verify(&codegen_output.stderr).is_err() { + return Ok(TestOutcome { + outcome: Err("The failure message returned by code generation doesn't match what we expected".into()), + codegen_output, + compilation_output: None, + test_output: None, + }); + } + Ok(TestOutcome { + outcome: Ok(()), + codegen_output, + compilation_output: None, + test_output: None, + }) + } + }; + } else if ExpectedOutcome::Fail == test.configuration.expectations.codegen { + return Ok(TestOutcome { + outcome: Err("We expected code generation to fail, but it succeeded!".into()), + codegen_output, + compilation_output: None, + test_output: None, + }); + }; + + if let ExpectedOutcome::Fail = test.configuration.expectations.lints { + let stderr_snapshot = SnapshotTest::new(expectations_directory.join("stderr.txt")); + if stderr_snapshot.verify(&codegen_output.stderr).is_err() { + return Ok(TestOutcome { + outcome: Err( + "The warnings returned by code generation don't match what we expected".into(), + ), + codegen_output, + compilation_output: None, + test_output: None, + }); + } + } + + let diagnostics_snapshot = SnapshotTest::new(expectations_directory.join("diagnostics.dot")); + let actual_diagnostics = + fs_err::read_to_string(test.runtime_directory.join("diagnostics.dot"))?; + // We don't exit early here to get the generated code snapshot as well. + // This allows to update both code snapshot and diagnostics snapshot in one go via + // `cargo r --bin snaps` for a failing test instead of having to do them one at a time, + // with a test run in the middle. + let diagnostics_outcome = diagnostics_snapshot.verify(&actual_diagnostics); + + let app_code_snapshot = SnapshotTest::new(expectations_directory.join("app.rs")); + let actual_app_code = + fs_err::read_to_string(test.generated_app_directory().join("src").join("lib.rs")).unwrap(); + let codegen_outcome = app_code_snapshot.verify(&actual_app_code); + + // Check that the generated code compiles + let output = std::process::Command::new("cargo") + // .env("RUSTFLAGS", "-Awarnings") + .arg("check") + .arg("--jobs") + .arg("1") + .arg("-p") + .arg("application") + .arg("--quiet") + .current_dir(&test.runtime_directory) + .output() + .unwrap(); + let compilation_output: Result = (&output).try_into(); + + if diagnostics_outcome.is_err() { + return Ok(TestOutcome { + outcome: Err( + "Diagnostics for the generated application don't match what we expected".into(), + ), + codegen_output, + compilation_output: None, + test_output: None, + }); + } + + if codegen_outcome.is_err() { + return Ok(TestOutcome { + outcome: Err("The generated application code doesn't match what we expected".into()), + codegen_output, + compilation_output: None, + test_output: None, + }); + } + + let compilation_output = compilation_output?; + if !output.status.success() { + return Ok(TestOutcome { + outcome: Err("The generated application code doesn't compile.".into()), + codegen_output, + compilation_output: Some(compilation_output), + test_output: None, + }); + } + + // Run integration tests, if we have any, + if let ShouldRunTests::Yes = test.should_run_tests() { + let output = std::process::Command::new("cargo") + // .env("RUSTFLAGS", "-Awarnings") + .arg("t") + .arg("--jobs") + .arg("1") + .arg("-p") + .arg("integration") + .current_dir(&test.runtime_directory) + .output() + .unwrap(); + let test_output: CommandOutput = (&output).try_into()?; + if !output.status.success() { + return Ok(TestOutcome { + outcome: Err("Integration tests failed.".into()), + codegen_output, + test_output: Some(test_output), + compilation_output: Some(compilation_output), + }); + } + } + + Ok(TestOutcome { + outcome: Ok(()), + codegen_output, + compilation_output: Some(compilation_output), + test_output: None, + }) +} + +struct TestOutcome { + outcome: Result<(), String>, + codegen_output: CommandOutput, + compilation_output: Option, + test_output: Option, +} + +/// A refined `std::process::Output` that assumes that both stderr and stdout are valid UTF8. +struct CommandOutput { + stdout: String, + stderr: String, +} + +impl TryFrom<&Output> for CommandOutput { + type Error = anyhow::Error; + + fn try_from(o: &Output) -> Result { + let stdout = std::str::from_utf8(&o.stdout) + .context("The application printed invalid UTF8 data to stdout")?; + let stderr = std::str::from_utf8(&o.stderr) + .context("The application printed invalid UTF8 data to stderr")?; + Ok(Self { + stdout: stdout.to_string(), + stderr: stderr.to_string(), + }) + } +} + +fn unexpected_failure_message(e: &anyhow::Error) -> String { + format!( + "An unexpected error was encountered when running a test.\n\n{}\n---\n{:?}", + &e, &e + ) +} + +fn enrich_failure_message(config: &TestConfig, error: impl AsRef) -> String { + let description = style(textwrap::indent(&config.description, " ")).cyan(); + let error = style(textwrap::indent(error.as_ref(), " ")).red(); + format!( + "{}\n{description}.\n{}\n{error}", + style("What is the test about:").cyan().dim().bold(), + style("What went wrong:").red().bold(), + ) +} diff --git a/libs/pavex_test_runner2/src/snapshot.rs b/libs/pavex_test_runner2/src/snapshot.rs new file mode 100644 index 000000000..7850fc9a1 --- /dev/null +++ b/libs/pavex_test_runner2/src/snapshot.rs @@ -0,0 +1,151 @@ +use std::io::ErrorKind; +use std::path::PathBuf; +use std::time::Duration; + +use console::style; +use regex::Captures; +use similar::{Algorithm, ChangeTag, TextDiff}; + +fn term_width() -> usize { + console::Term::stdout().size().1 as usize +} + +pub(crate) struct SnapshotTest { + expectation_path: PathBuf, +} + +impl SnapshotTest { + pub fn new(expectation_path: PathBuf) -> Self { + Self { expectation_path } + } + + pub fn verify(&self, actual: &str) -> Result<(), ()> { + let expected = match fs_err::read_to_string(&self.expectation_path) { + Ok(s) => s, + Err(e) if e.kind() == ErrorKind::NotFound => "".into(), + outcome @ Err(_) => { + outcome.expect("Failed to load the expected value for a snapshot test") + } + }; + let trimmed_expected = expected.trim(); + let actual = actual.trim(); + + // Replace all line endings with `\n` to make sure that the snapshots are cross-platform. + let trimmed_expected = trimmed_expected.replace("\r\n", "\n"); + let actual = actual.replace("\r\n", "\n"); + + // Path normalization for Windows, which uses `\` instead of `/` as path separator. + static RE: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| { + regex::Regex::new(r#"(?\[\[36;1;4m)(?.*)"#).unwrap() + }); + let normalizer = |c: &Captures| { + let prefix = c.name("prefix").unwrap().as_str(); + let path = c.name("path").unwrap().as_str().replace("\\", "/"); + format!("{prefix}{path}",) + }; + let trimmed_expected = RE.replace_all(&trimmed_expected, normalizer); + let actual = RE.replace_all(&actual, normalizer); + + let expectation_directory = self.expectation_path.parent().unwrap(); + let last_snapshot_path = expectation_directory.join(format!( + "{}.snap", + self.expectation_path.file_name().unwrap().to_string_lossy() + )); + + if trimmed_expected != actual { + print_changeset(&trimmed_expected, &actual); + fs_err::write(last_snapshot_path, actual.as_ref()) + .expect("Failed to save the actual value for a failed snapshot test"); + Err(()) + } else { + let _ = fs_err::remove_file(last_snapshot_path); + Ok(()) + } + } +} + +pub fn print_changeset(old: &str, new: &str) { + let width = term_width(); + let diff = TextDiff::configure() + .algorithm(Algorithm::Patience) + .timeout(Duration::from_millis(500)) + .diff_lines(old, new); + println!("{:─^1$}", "", width); + + if !old.is_empty() { + println!("{}", style("-old snapshot").red()); + println!("{}", style("+new results").green()); + } else { + println!("{}", style("+new results").green()); + } + + println!("────────────┬{:─^1$}", "", width.saturating_sub(13)); + let mut has_changes = false; + for (idx, group) in diff.grouped_ops(4).iter().enumerate() { + if idx > 0 { + println!("β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Ό{:β”ˆ^1$}", "", width.saturating_sub(13)); + } + for op in group { + for change in diff.iter_inline_changes(op) { + match change.tag() { + ChangeTag::Insert => { + has_changes = true; + print!( + "{:>5} {:>5} β”‚{}", + "", + style(change.new_index().unwrap()).cyan().dim().bold(), + style("+").green(), + ); + for &(emphasized, change) in change.values() { + if emphasized { + print!("{}", style(change).green().underlined()); + } else { + print!("{}", style(change).green()); + } + } + } + ChangeTag::Delete => { + has_changes = true; + print!( + "{:>5} {:>5} β”‚{}", + style(change.old_index().unwrap()).cyan().dim(), + "", + style("-").red(), + ); + for &(emphasized, change) in change.values() { + if emphasized { + print!("{}", style(change).red().underlined()); + } else { + print!("{}", style(change).red()); + } + } + } + ChangeTag::Equal => { + print!( + "{:>5} {:>5} β”‚ ", + style(change.old_index().unwrap()).cyan().dim(), + style(change.new_index().unwrap()).cyan().dim().bold(), + ); + for &(_, change) in change.values() { + print!("{}", style(change).dim()); + } + } + } + if change.missing_newline() { + println!(); + } + } + } + } + + if !has_changes { + println!( + "{:>5} {:>5} β”‚{}", + "", + style("-").dim(), + style(" snapshots are matching").cyan(), + ); + } + + println!("────────────┴{:─^1$}", "", width.saturating_sub(13),); +} diff --git a/libs/pavex_test_runner2/src/target_directory.rs b/libs/pavex_test_runner2/src/target_directory.rs new file mode 100644 index 000000000..4e87b98ab --- /dev/null +++ b/libs/pavex_test_runner2/src/target_directory.rs @@ -0,0 +1,62 @@ +//! Assigning a distinct target directory to each test case doesn't scale. +//! Those directories are big and can easily fill up your disk (and they +//! have started to do so once the number of tests grew to 50+). +//! +//! This module provides functionality to re-use target directories across +//! different test cases. +//! We create N target directories, where N is the number of cores on the +//! machine. Each test case is assigned a target directory from this pool +//! once it kicks off. +//! Since the test runner doesn't execute more than N test cases in +//! parallel, this approach guarantees that test cases don't have to wait +//! to be assigned a target directory (i.e. we still get maximum parallelism). +//! +//! We can't reuse the same target directory for all tests since each test +//! needs to acquire a unique lock on the target directory in order to +//! execute `cargo` commands. Having a single target directory would +//! serialize all tests, which would be a huge performance hit. + +use std::{ + path::{Path, PathBuf}, + sync::Arc, +}; + +use object_pool::Reusable; + +#[derive(Clone)] +pub struct TargetDirectoryPool { + directories: Arc>, +} + +impl TargetDirectoryPool { + pub fn new(size: Option, test_env_dir: &Path) -> Self { + let size = size.unwrap_or_else(num_cpus::get); + // The function signature here is awkward because it doesn't allow us to + // borrow from the environment in the closure, which in turns means we can't guarantee deterministic names for the target directories. + // We work around the issue by attaching objects to the pool manually + let directories = object_pool::Pool::new(0, || { + panic!("Target directories should never be initialized via the init closure") + }); + for i in 0..size { + directories.attach(create_target_directory(test_env_dir, i)); + } + Self { + directories: Arc::new(directories), + } + } + + /// Pull a target directory from the pool. + pub fn pull(&self) -> Reusable<'_, PathBuf> { + self.directories + .try_pull() + .expect("Failed to pull a target directory from the pool") + } +} + +fn create_target_directory(test_env_dir: &Path, i: usize) -> PathBuf { + let target_dir_path = test_env_dir + .join("target_dirs") + .join(format!("target_{:0>2}", i)); + fs_err::create_dir_all(&target_dir_path).expect("Failed to create target directory"); + target_dir_path +} From ab3190a3e988cae4526ca125e288388562a1c6b1 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:16:32 +0200 Subject: [PATCH 03/16] Cache what's cacheable --- libs/Cargo.lock | 2 + .../expectations/diagnostics.dot | 4 +- libs/pavex_test_runner2/Cargo.toml | 2 + libs/pavex_test_runner2/src/lib.rs | 113 ++++++++++++------ libs/pavexc/src/compiler/app.rs | 8 +- libs/pavexc/src/lib.rs | 2 +- libs/pavexc/src/rustdoc/compute/cache.rs | 32 +++-- libs/pavexc/src/rustdoc/compute/checksum.rs | 30 +++-- libs/pavexc/src/rustdoc/compute/mod.rs | 15 ++- libs/pavexc/src/rustdoc/package_id_spec.rs | 2 +- libs/pavexc/src/rustdoc/queries.rs | 34 ++++-- 11 files changed, 176 insertions(+), 68 deletions(-) diff --git a/libs/Cargo.lock b/libs/Cargo.lock index 24ea2cdca..8916c4353 100644 --- a/libs/Cargo.lock +++ b/libs/Cargo.lock @@ -2329,12 +2329,14 @@ dependencies = [ "console", "fs-err", "globwalk", + "guppy", "itertools 0.12.1", "libtest-mimic", "miette", "num_cpus", "object-pool", "once_cell", + "pavexc", "persist_if_changed", "px_workspace_hack", "regex", diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot b/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot index 19b619de1..2d952b198 100644 --- a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot +++ b/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot @@ -9,7 +9,7 @@ digraph "GET /route - 0" { } digraph "GET /route - 1" { - 0 [ label = "app::root() -> pavex::response::Response"] + 0 [ label = "app_56967fe8::root() -> pavex::response::Response"] 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] 0 -> 1 [ ] } @@ -27,7 +27,7 @@ digraph "* /route - 0" { } digraph "* /route - 1" { - 0 [ label = "app::get_connection_info(&pavex::connection::ConnectionInfo) -> pavex::response::Response"] + 0 [ label = "app_56967fe8::get_connection_info(&pavex::connection::ConnectionInfo) -> pavex::response::Response"] 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] 3 [ label = "&pavex::connection::ConnectionInfo"] 0 -> 2 [ ] diff --git a/libs/pavex_test_runner2/Cargo.toml b/libs/pavex_test_runner2/Cargo.toml index 4f205b4bc..f4d74a4f2 100644 --- a/libs/pavex_test_runner2/Cargo.toml +++ b/libs/pavex_test_runner2/Cargo.toml @@ -34,3 +34,5 @@ tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] } regex = { workspace = true } once_cell = { workspace = true } px_workspace_hack = { version = "0.1", path = "../px_workspace_hack" } +pavexc = { path = "../pavexc" } +guppy = { workspace = true } diff --git a/libs/pavex_test_runner2/src/lib.rs b/libs/pavex_test_runner2/src/lib.rs index b79fa8662..8ee379dfa 100644 --- a/libs/pavex_test_runner2/src/lib.rs +++ b/libs/pavex_test_runner2/src/lib.rs @@ -3,11 +3,14 @@ use std::fmt::Write; use std::path::{Component, Path, PathBuf}; use std::process::{Command, Output}; -use ahash::HashMap; +use ahash::{HashMap, HashSet}; use anyhow::Context; use console::style; +use guppy::PackageId; use itertools::Itertools; use libtest_mimic::{Conclusion, Failed}; +use pavexc::rustdoc::CrateCollection; +use pavexc::DEFAULT_DOCS_TOOLCHAIN; use sha2::Digest; use toml::toml; use walkdir::WalkDir; @@ -72,7 +75,7 @@ pub fn run_tests( create_tests_dir(&runtime_directory, &test_name2test_data, &pavex_cli)?; if !arguments.list { - warm_up_target_dir(&runtime_directory)?; + warm_up_target_dir(&runtime_directory, &test_name2test_data)?; } let mut tests = Vec::new(); @@ -91,26 +94,29 @@ pub fn run_tests( /// Compile all binary targets of the type `app_*`. /// This ensures that all dependencies have been compiled, speeding up further operations, /// as well as preparing the binaries that each test will invoke. -fn warm_up_target_dir(runtime_directory: &Path) -> Result<(), anyhow::Error> { +fn warm_up_target_dir( + runtime_directory: &Path, + test_name2test_data: &BTreeMap, +) -> Result<(), anyhow::Error> { println!("Creating a workspace-hack crate to unify dependencies"); // Clean up pre-existing workspace_hack, since `cargo hakari init` will fail // if it already exists. - let _ = fs_err::remove_dir_all(runtime_directory.join("workspace_hack")); - let _ = fs_err::remove_file(runtime_directory.join(".config").join("hakari.toml")); - - let mut cmd = Command::new("cargo"); - cmd.arg("hakari") - .arg("init") - .arg("-y") - .arg("workspace_hack") - .current_dir(runtime_directory) - .stdout(std::process::Stdio::inherit()) - .stderr(std::process::Stdio::inherit()); - let status = cmd.status()?; - if !status.success() { - anyhow::bail!("Failed to create workspace_hack crate"); - } + // let _ = fs_err::remove_dir_all(runtime_directory.join("workspace_hack")); + // let _ = fs_err::remove_file(runtime_directory.join(".config").join("hakari.toml")); + + // let mut cmd = Command::new("cargo"); + // cmd.arg("hakari") + // .arg("init") + // .arg("-y") + // .arg("workspace_hack") + // .current_dir(runtime_directory) + // .stdout(std::process::Stdio::inherit()) + // .stderr(std::process::Stdio::inherit()); + // let status = cmd.status()?; + // if !status.success() { + // anyhow::bail!("Failed to create workspace_hack crate"); + // } let mut cmd = Command::new("cargo"); cmd.arg("hakari") @@ -123,18 +129,19 @@ fn warm_up_target_dir(runtime_directory: &Path) -> Result<(), anyhow::Error> { anyhow::bail!("Failed to generate workspace_hack crate"); } - let mut cmd = Command::new("cargo"); - cmd.arg("hakari") - .arg("manage-deps") - .arg("-y") - .current_dir(runtime_directory) - .stdout(std::process::Stdio::inherit()) - .stderr(std::process::Stdio::inherit()); - let status = cmd.status()?; - if !status.success() { - anyhow::bail!("Failed to manage workspace_hack dependencies"); - } + // let mut cmd = Command::new("cargo"); + // cmd.arg("hakari") + // .arg("manage-deps") + // .arg("-y") + // .current_dir(runtime_directory) + // .stdout(std::process::Stdio::inherit()) + // .stderr(std::process::Stdio::inherit()); + // let status = cmd.status()?; + // if !status.success() { + // anyhow::bail!("Failed to manage workspace_hack dependencies"); + // } + let timer = std::time::Instant::now(); println!("Warming up the target directory"); let mut cmd = Command::new("cargo"); cmd.arg("build") @@ -146,6 +153,41 @@ fn warm_up_target_dir(runtime_directory: &Path) -> Result<(), anyhow::Error> { if !status.success() { anyhow::bail!("Failed to compile the test binaries"); } + println!( + "Warmed up the target directory in {} seconds", + timer.elapsed().as_secs() + ); + + let timer = std::time::Instant::now(); + println!("Pre-computing JSON documentation for relevant crates"); + let crate_collection = CrateCollection::new( + runtime_directory.to_string_lossy().into_owned(), + DEFAULT_DOCS_TOOLCHAIN.to_owned(), + runtime_directory.to_path_buf(), + )?; + let mut crates = test_name2test_data + .values() + .map(|data| format!("app_{}", data.name_hash)) + .collect::>(); + crates.insert("pavex".into()); + crates.insert("tracing".into()); + crates.insert("equivalent".into()); + crates.insert("ppv-lite86".into()); + crates.insert("hashbrown".into()); + crates.insert("typenum".into()); + let package_ids = crate_collection + .package_graph() + .packages() + .filter(|p| crates.contains(p.name())) + .map(|p| p.id().to_owned()); + crate_collection + .batch_compute_crates(package_ids) + .context("Failed to warm rustdoc JSON cache")?; + println!( + "Pre-computed JSON documentation in {} seconds", + timer.elapsed().as_secs() + ); + Ok(()) } @@ -179,6 +221,11 @@ fn create_tests_dir( "pavex_cli_client = {{ path = \"../pavex_cli_client\" }}" ) .unwrap(); + writeln!( + &mut cargo_toml, + "workspace_hack = {{ path = \"workspace_hack\" }}" + ) + .unwrap(); writeln!(&mut cargo_toml, "tokio = \"1\"").unwrap(); writeln!(&mut cargo_toml, "reqwest = \"0.12\"").unwrap(); @@ -527,6 +574,7 @@ impl TestData { [dependencies] pavex = { workspace = true } pavex_cli_client = { workspace = true } + workspace_hack = { workspace = true } }; cargo_toml["package"]["name"] = format!("app_{}", self.name_hash).into(); let deps = cargo_toml @@ -660,10 +708,7 @@ fn _run_test( .join(&binary_name); let output = std::process::Command::new(binary) .env("PAVEX_PAVEXC", pavexc_cli) - .env("PAVEXC_LOG", "true") .current_dir(&test.runtime_directory) - .stderr(std::process::Stdio::inherit()) - .stdout(std::process::Stdio::inherit()) .output() .context("Failed to perform code generation")?; println!("Ran {binary_name} in {} seconds", timer.elapsed().as_secs()); @@ -742,7 +787,7 @@ fn _run_test( .arg("--jobs") .arg("1") .arg("-p") - .arg("application") + .arg(format!("application_{}", test.name_hash)) .arg("--quiet") .current_dir(&test.runtime_directory) .output() @@ -787,7 +832,7 @@ fn _run_test( .arg("--jobs") .arg("1") .arg("-p") - .arg("integration") + .arg(format!("integration_{}", test.name_hash)) .current_dir(&test.runtime_directory) .output() .unwrap(); diff --git a/libs/pavexc/src/compiler/app.rs b/libs/pavexc/src/compiler/app.rs index e3fa14f9c..40dda4008 100644 --- a/libs/pavexc/src/compiler/app.rs +++ b/libs/pavexc/src/compiler/app.rs @@ -80,8 +80,12 @@ impl App { }; } - let krate_collection = CrateCollection::new(project_fingerprint, docs_toolchain_name) - .map_err(|e| vec![anyhow2miette(e)])?; + let krate_collection = CrateCollection::new( + project_fingerprint, + docs_toolchain_name, + std::env::current_dir().expect("Failed to determine the current directory"), + ) + .map_err(|e| vec![anyhow2miette(e)])?; let package_graph = krate_collection.package_graph().to_owned(); let mut diagnostics = vec![]; let mut computation_db = ComputationDb::new(); diff --git a/libs/pavexc/src/lib.rs b/libs/pavexc/src/lib.rs index 061b34e13..2f723b2ba 100644 --- a/libs/pavexc/src/lib.rs +++ b/libs/pavexc/src/lib.rs @@ -7,7 +7,7 @@ mod compiler; mod diagnostic; pub(crate) mod language; mod persistence; -mod rustdoc; +pub mod rustdoc; mod utils; /// The Rust toolchain used by `pavexc` to generate JSON docs, unless diff --git a/libs/pavexc/src/rustdoc/compute/cache.rs b/libs/pavexc/src/rustdoc/compute/cache.rs index 0ee3354be..56a0b611c 100644 --- a/libs/pavexc/src/rustdoc/compute/cache.rs +++ b/libs/pavexc/src/rustdoc/compute/cache.rs @@ -64,12 +64,13 @@ impl RustdocGlobalFsCache { pub(crate) fn get( &self, cache_key: &RustdocCacheKey, + package_graph: &PackageGraph, ) -> Result, anyhow::Error> { let connection = self.connection_pool.get()?; match cache_key { RustdocCacheKey::ThirdPartyCrate(metadata) => { self.third_party_cache - .get(metadata, &self.cargo_fingerprint, &connection) + .get(metadata, &self.cargo_fingerprint, &connection, package_graph) } RustdocCacheKey::ToolchainCrate(name) => { self.toolchain_cache @@ -83,12 +84,13 @@ impl RustdocGlobalFsCache { &self, cache_key: &RustdocCacheKey, krate: &crate::rustdoc::Crate, + package_graph: &PackageGraph ) -> Result<(), anyhow::Error> { let connection = self.connection_pool.get()?; match cache_key { RustdocCacheKey::ThirdPartyCrate(metadata) => { self.third_party_cache - .insert(metadata, krate, &self.cargo_fingerprint, &connection) + .insert(metadata, krate, &self.cargo_fingerprint, &connection, package_graph) } RustdocCacheKey::ToolchainCrate(name) => { self.toolchain_cache @@ -354,14 +356,16 @@ impl ThirdPartyCrateCache { package_metadata: &PackageMetadata, cargo_fingerprint: &str, connection: &rusqlite::Connection, + package_graph: &PackageGraph, ) -> Result, anyhow::Error> { fn _get( package_metadata: &PackageMetadata, cargo_fingerprint: &str, connection: &rusqlite::Connection, + package_graph: &PackageGraph, ) -> Result, anyhow::Error> { let Some(cache_key) = - ThirdPartyCrateCacheKey::build(package_metadata, cargo_fingerprint) + ThirdPartyCrateCacheKey::build(package_graph, package_metadata, cargo_fingerprint) else { return Ok(None); }; @@ -442,7 +446,7 @@ impl ThirdPartyCrateCache { Ok(Some(krate)) } - let outcome = _get(package_metadata, cargo_fingerprint, connection); + let outcome = _get(package_metadata, cargo_fingerprint, connection, package_graph); match &outcome { Ok(Some(_)) => { tracing::Span::current().record("hit", true); @@ -468,8 +472,9 @@ impl ThirdPartyCrateCache { krate: &crate::rustdoc::Crate, cargo_fingerprint: &str, connection: &rusqlite::Connection, + package_graph: &PackageGraph ) -> Result<(), anyhow::Error> { - let Some(cache_key) = ThirdPartyCrateCacheKey::build(package_metadata, cargo_fingerprint) + let Some(cache_key) = ThirdPartyCrateCacheKey::build(package_graph, package_metadata, cargo_fingerprint) else { return Ok(()); }; @@ -688,6 +693,7 @@ pub(super) struct ThirdPartyCrateCacheKey<'a> { impl<'a> ThirdPartyCrateCacheKey<'a> { /// Compute the cache key for a given package. pub(super) fn build( + package_graph: &PackageGraph, package_metadata: &'a PackageMetadata<'a>, cargo_fingerprint: &'a str, ) -> Option> { @@ -701,18 +707,28 @@ impl<'a> ThirdPartyCrateCacheKey<'a> { }; let crate_hash = if let guppy::graph::PackageSource::Path(package_path) = package_metadata.source() { + let package_path = if package_path.is_relative() { + package_graph.workspace().root().join(package_path) + } else { + package_path.to_owned() + }; // We need to compute the hash of the package's contents, // to invalidate the cache when the package changes. // This is only relevant for path dependencies. // We don't need to do this for external dependencies, // since they are assumed to be immutable. - let Ok(hash) = checksum_crate(package_path) else { + let hash = match checksum_crate(&package_path) { + Ok(hash) => hash, + Err(e) => { tracing::warn!( - "Failed to compute the hash of the package at {:?}. + error.message = %e, + error.details = ?e, + "Failed to compute the hash of the package at {}. I won't cache its JSON documentation to avoid serving stale data.", - package_metadata.id() + package_metadata.id().repr() ); return None; + } }; Some(hash.to_string()) } else { diff --git a/libs/pavexc/src/rustdoc/compute/checksum.rs b/libs/pavexc/src/rustdoc/compute/checksum.rs index 4f0163fd4..737e94824 100644 --- a/libs/pavexc/src/rustdoc/compute/checksum.rs +++ b/libs/pavexc/src/rustdoc/compute/checksum.rs @@ -1,7 +1,7 @@ use core::str; use anyhow::Context; -use camino::Utf8Path; +use camino::{Utf8Path, Utf8PathBuf}; /// Checksum the contents of the crate at the given path in order /// to verify that the contents have not changed. @@ -11,7 +11,24 @@ use camino::Utf8Path; /// 1. Determine which files are in scope. This is done via `cargo package --list`, /// to avoid checksumming files that are not part of the crate (e.g. its target directory). /// 2. Calculate the checksum of everything that was discovered, including the file names. +#[tracing::instrument("Checksum crate files", level = tracing::Level::DEBUG)] pub(super) fn checksum_crate(root_path: &Utf8Path) -> Result { + let paths = get_paths(root_path)?; + + let mut hasher = xxhash_rust::xxh64::Xxh64::new(0); + for path in paths { + // Read and hash the file contents + // We don't check if the path is a directory because `cargo package --list` + // only lists files + let contents = + std::fs::read(&path).with_context(|| format!("Failed to read file at `{}`", path))?; + hasher.update(&contents); + } + Ok(hasher.digest()) +} + +#[tracing::instrument("Get file paths via `cargo package --list`", level = tracing::Level::DEBUG)] +fn get_paths(root_path: &Utf8Path) -> Result, anyhow::Error> { let mut command = std::process::Command::new("cargo"); command .arg("package") @@ -31,7 +48,7 @@ pub(super) fn checksum_crate(root_path: &Utf8Path) -> Result let stdout = str::from_utf8(&output.stdout).context("`cargo package --list` returned non-UTF8 paths")?; - let mut hasher = xxhash_rust::xxh64::Xxh64::new(0); + let mut files = Vec::new(); for line in stdout.lines() { if line == "Cargo.toml.orig" || line == ".cargo_vcs_info.json" { // Skip these files, they are not part of the crate @@ -40,12 +57,7 @@ pub(super) fn checksum_crate(root_path: &Utf8Path) -> Result } // All paths are relative to the root let path = root_path.join(line); - // Read and hash the file contents - // We don't check if the path is a directory because `cargo package --list` - // only lists files - let contents = - std::fs::read(&path).with_context(|| format!("Failed to read file at `{}`", path))?; - hasher.update(&contents); + files.push(path); } - Ok(hasher.digest()) + Ok(files) } diff --git a/libs/pavexc/src/rustdoc/compute/mod.rs b/libs/pavexc/src/rustdoc/compute/mod.rs index 3af879a64..dc0fed2ab 100644 --- a/libs/pavexc/src/rustdoc/compute/mod.rs +++ b/libs/pavexc/src/rustdoc/compute/mod.rs @@ -52,11 +52,13 @@ pub(super) fn compute_crate_docs( toolchain_name: &str, package_graph: &PackageGraph, package_id: &PackageId, + current_dir: &Path, ) -> Result { fn inner( package_graph: &PackageGraph, package_id: &PackageId, toolchain_name: &str, + current_dir: &Path, ) -> Result { // Some crates are not compiled as part of the dependency tree of the current workspace. // They are instead bundled as part of Rust's toolchain and automatically available for import @@ -74,7 +76,7 @@ pub(super) fn compute_crate_docs( package_spec: package_id.to_string(), source: Arc::new(e), })?; - _compute_crate_docs(toolchain_name, std::iter::once(&package_spec))?; + _compute_crate_docs(toolchain_name, std::iter::once(&package_spec), current_dir)?; let target_directory = package_graph.workspace().target_directory().as_std_path(); load_json_docs(target_directory, &package_spec) @@ -85,7 +87,7 @@ pub(super) fn compute_crate_docs( // error. // It's easier to do that here, rather than in the `inner` function, because we would need to // map the error of _every single fallible operation_. - inner(package_graph, package_id, toolchain_name).map_err(|e| CannotGetCrateData { + inner(package_graph, package_id, toolchain_name, current_dir).map_err(|e| CannotGetCrateData { package_spec: package_id.repr().to_owned(), source: Arc::new(e), }) @@ -104,6 +106,7 @@ pub(super) fn batch_compute_crate_docs( toolchain_name: &str, package_graph: &PackageGraph, package_ids: I, + current_dir: &Path, ) -> Result, anyhow::Error> where I: Iterator, @@ -155,7 +158,11 @@ where }; for chunk in chunks { - _compute_crate_docs(toolchain_name, chunk.iter().map(|(_, spec)| spec))?; + _compute_crate_docs( + toolchain_name, + chunk.iter().map(|(_, spec)| spec), + current_dir, + )?; let target_directory = package_graph.workspace().target_directory().as_std_path(); // It takes a while to deserialize the JSON output of `cargo rustdoc`, so we parallelize @@ -194,6 +201,7 @@ pub(super) fn rustdoc_options() -> [&'static str; 4] { fn _compute_crate_docs<'a, I>( toolchain_name: &str, package_id_specs: I, + current_dir: &Path, ) -> Result<(), anyhow::Error> where I: Iterator, @@ -202,6 +210,7 @@ where // a good error. let mut cmd = std::process::Command::new("rustup"); cmd.arg("run") + .current_dir(current_dir) .arg(toolchain_name) .arg("cargo") .arg("doc") diff --git a/libs/pavexc/src/rustdoc/package_id_spec.rs b/libs/pavexc/src/rustdoc/package_id_spec.rs index fcfab1e27..6f0f7b086 100644 --- a/libs/pavexc/src/rustdoc/package_id_spec.rs +++ b/libs/pavexc/src/rustdoc/package_id_spec.rs @@ -40,7 +40,7 @@ impl PackageIdSpecification { } else { source.to_string() }; - format!("file:///{source}") + format!("file://{source}") } } PackageSource::External(source) => { diff --git a/libs/pavexc/src/rustdoc/queries.rs b/libs/pavexc/src/rustdoc/queries.rs index 2e3634ae9..29d8ebcdb 100644 --- a/libs/pavexc/src/rustdoc/queries.rs +++ b/libs/pavexc/src/rustdoc/queries.rs @@ -1,5 +1,6 @@ use std::borrow::Cow; use std::collections::BTreeSet; +use std::path::PathBuf; use std::sync::Arc; use std::thread; @@ -57,10 +58,11 @@ impl std::fmt::Debug for CrateCollection { } #[tracing::instrument] -fn compute_package_graph() -> Result { +fn compute_package_graph(current_directory: PathBuf) -> Result { // `cargo metadata` seems to be the only reliable way of retrieving the path to // the root manifest of the current workspace for a Rust project. guppy::MetadataCommand::new() + .current_dir(current_directory) .exec() .map_err(|e| anyhow!(e))? .build_graph() @@ -69,11 +71,15 @@ fn compute_package_graph() -> Result { impl CrateCollection { /// Initialise the collection for a `PackageGraph`. - pub fn new(project_fingerprint: String, toolchain_name: String) -> Result { + pub fn new( + project_fingerprint: String, + toolchain_name: String, + workspace_directory: PathBuf, + ) -> Result { let span = Span::current(); let thread_handle = thread::spawn(move || { let _guard = span.enter(); - compute_package_graph() + compute_package_graph(workspace_directory) }); let cache = RustdocGlobalFsCache::new(&toolchain_name)?; @@ -157,7 +163,7 @@ impl CrateCollection { cache: RustdocGlobalFsCache, ) -> (PackageId, Option) { let cache_key = RustdocCacheKey::new(&package_id, &package_graph); - match cache.get(&cache_key) { + match cache.get(&cache_key, &package_graph) { Ok(o) => (package_id, o), Err(e) => { tracing::warn!( @@ -201,6 +207,7 @@ impl CrateCollection { &self.toolchain_name, &self.package_graph, to_be_computed.into_iter(), + self.package_graph.workspace().root().as_std_path(), )?; for (package_id, krate) in results { @@ -212,7 +219,10 @@ impl CrateCollection { // Let's make sure to store them in the on-disk cache for next time. let cache_key = RustdocCacheKey::new(&package_id, &self.package_graph); - if let Err(e) = self.disk_cache.insert(&cache_key, &krate) { + if let Err(e) = self + .disk_cache + .insert(&cache_key, &krate, &self.package_graph) + { tracing::warn!( error.msg = tracing::field::display(&e), error.error_chain = tracing::field::debug(&e), @@ -243,7 +253,7 @@ impl CrateCollection { // If not, let's try to retrieve them from the on-disk cache. let cache_key = RustdocCacheKey::new(package_id, &self.package_graph); - match self.disk_cache.get(&cache_key) { + match self.disk_cache.get(&cache_key, &self.package_graph) { Ok(Some(krate)) => { self.package_id2krate .insert(package_id.to_owned(), Box::new(krate)); @@ -261,14 +271,22 @@ impl CrateCollection { } // If we don't have them in the on-disk cache, we need to compute them. - let krate = compute_crate_docs(&self.toolchain_name, &self.package_graph, package_id)?; + let krate = compute_crate_docs( + &self.toolchain_name, + &self.package_graph, + package_id, + self.package_graph.workspace().root().as_std_path(), + )?; let krate = Crate::new(krate, package_id.to_owned()).map_err(|e| CannotGetCrateData { package_spec: package_id.to_string(), source: Arc::new(e), })?; // Let's make sure to store them in the on-disk cache for next time. - if let Err(e) = self.disk_cache.insert(&cache_key, &krate) { + if let Err(e) = self + .disk_cache + .insert(&cache_key, &krate, &self.package_graph) + { tracing::warn!( error.msg = tracing::field::display(&e), error.error_chain = tracing::field::debug(&e), From 7ea7aa78be1313a12106607a42359e4c0b6f182a Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Sun, 22 Sep 2024 13:57:33 +0200 Subject: [PATCH 04/16] Let's try faster tests in CI --- libs/Cargo.lock | 30 +- libs/pavex_cli/Cargo.toml | 2 +- .../ui_tests/app_builder/expectations/app.rs | 4 +- .../expectations/app.rs | 4 +- .../expectations/stderr.txt | 50 +- .../expectations/stderr.txt | 16 +- .../expectations/stderr.txt | 20 +- .../expectations/stderr.txt | 63 +- .../expectations/stderr.txt | 14 +- .../expectations/stderr.txt | 9 +- .../expectations/stderr.txt | 4 +- .../expectations/stderr.txt | 12 +- .../expectations/stderr.txt | 12 +- .../expectations/stderr.txt | 15 +- .../expectations/stderr.txt | 2 +- .../expectations/stderr.txt | 2 +- .../expectations/stderr.txt | 4 +- .../expectations/stderr.txt | 7 +- .../expectations/stderr.txt | 12 +- .../expectations/stderr.txt | 12 +- .../expectations/stderr.txt | 2 +- .../expectations/stderr.txt | 2 +- .../expectations/stderr.txt | 6 +- .../expectations/stderr.txt | 4 +- .../expectations/stderr.txt | 6 +- .../expectations/stderr.txt | 14 +- .../expectations/stderr.txt | 2 +- .../expectations/stderr.txt | 2 +- .../expectations/stderr.txt | 12 +- .../expectations/stderr.txt | 12 +- .../invalid_prebuilt/expectations/stderr.txt | 20 +- .../expectations/app.rs | 15 +- .../expectations/stderr.txt | 6 +- .../expectations/stderr.txt | 4 +- .../expectations/stderr.txt | 10 +- .../invalid_paths/expectations/stderr.txt | 8 +- .../expectations/stderr.txt | 2 +- .../expectations/stderr.txt | 5 +- .../expectations/stderr.txt | 2 +- .../expectations/stderr.txt | 2 +- .../expectations/stderr.txt | 10 +- .../expectations/stderr.txt | 12 +- .../expectations/stderr.txt | 9 +- .../expectations/stderr.txt | 8 +- .../expectations/stderr.txt | 8 +- .../expectations/stderr.txt | 20 +- .../expectations/stderr.txt | 22 +- .../expectations/stderr.txt | 4 +- .../expectations/stderr.txt | 16 +- .../expectations/stderr.txt | 20 +- .../expectations/stderr.txt | 18 +- .../mutability/expectations/stderr.txt | 7 +- .../expectations/stderr.txt | 16 +- .../expectations/stderr.txt | 4 +- .../expectations/stderr.txt | 12 +- .../expectations/stderr.txt | 16 +- .../expectations/diagnostics.dot | 4 +- .../expectations/stderr.txt | 6 +- .../expectations/stderr.txt | 9 +- .../transient_cycles/expectations/stderr.txt | 9 +- .../expectations/stderr.txt | 5 +- .../expectations/stderr.txt | 8 +- .../expectations/stderr.txt | 6 +- .../expectations/stderr.txt | 6 +- .../expectations/stderr.txt | 11 +- .../expectations/app.rs | 8 +- .../expectations/stderr.txt | 10 +- .../expectations/app.rs | 4 +- .../expectations/stderr.txt | 30 +- .../expectations/stderr.txt | 7 +- .../expectations/stderr.txt | 8 +- .../expectations/app.rs | 16 +- .../expectations/app.rs | 5 +- .../expectations/stderr.txt | 23 +- .../expectations/stderr.txt | 73 +- .../expectations/stderr.txt | 2 +- .../expectations/app.rs | 4 +- .../expectations/app.rs | 2 +- .../expectations/diagnostics.dot | 4 +- .../expectations/stderr.txt | 2 +- .../expectations/app.rs | 6 +- .../expectations/diagnostics.dot | 6 +- .../expectations/app.rs | 4 +- .../expectations/diagnostics.dot | 4 +- .../expectations/stderr.txt | 2 +- .../expectations/stderr.txt | 2 +- .../expectations/app.rs | 4 +- .../expectations/stderr.txt | 4 +- .../expectations/app.rs | 4 +- .../expectations/app.rs | 16 +- .../expectations/diagnostics.dot | 12 +- .../expectations/stderr.txt | 2 +- .../expectations/app.rs | 12 +- .../expectations/app.rs | 14 +- .../expectations/diagnostics.dot | 12 +- libs/pavex_test_runner/Cargo.toml | 6 +- libs/pavex_test_runner/src/lib.rs | 558 +++++++---- libs/pavex_test_runner/src/snapshot.rs | 12 +- libs/pavex_test_runner2/Cargo.toml | 38 - libs/pavex_test_runner2/src/lib.rs | 901 ------------------ libs/pavex_test_runner2/src/snapshot.rs | 151 --- .../src/target_directory.rs | 62 -- 102 files changed, 915 insertions(+), 1811 deletions(-) delete mode 100644 libs/pavex_test_runner2/Cargo.toml delete mode 100644 libs/pavex_test_runner2/src/lib.rs delete mode 100644 libs/pavex_test_runner2/src/snapshot.rs delete mode 100644 libs/pavex_test_runner2/src/target_directory.rs diff --git a/libs/Cargo.lock b/libs/Cargo.lock index 8916c4353..8b4eba678 100644 --- a/libs/Cargo.lock +++ b/libs/Cargo.lock @@ -2165,7 +2165,7 @@ dependencies = [ "owo-colors", "pavex_cli_deps", "pavex_miette", - "pavex_test_runner2", + "pavex_test_runner", "pavexc", "pavexc_cli_client", "pem", @@ -2295,34 +2295,6 @@ dependencies = [ [[package]] name = "pavex_test_runner" version = "0.1.48" -dependencies = [ - "ahash", - "anyhow", - "console", - "fs-err", - "globwalk", - "itertools 0.12.1", - "libtest-mimic", - "miette", - "num_cpus", - "object-pool", - "once_cell", - "persist_if_changed", - "px_workspace_hack", - "regex", - "serde", - "serde_json", - "sha2", - "similar", - "textwrap", - "toml", - "tracing-subscriber", - "walkdir", -] - -[[package]] -name = "pavex_test_runner2" -version = "0.1.48" dependencies = [ "ahash", "anyhow", diff --git a/libs/pavex_cli/Cargo.toml b/libs/pavex_cli/Cargo.toml index f889d1d0a..355f21fa3 100644 --- a/libs/pavex_cli/Cargo.toml +++ b/libs/pavex_cli/Cargo.toml @@ -68,6 +68,6 @@ time = { workspace = true } px_workspace_hack = { version = "0.1", path = "../px_workspace_hack" } [dev-dependencies] -pavex_test_runner = { path = "../pavex_test_runner2", package = "pavex_test_runner2" } +pavex_test_runner = { path = "../pavex_test_runner" } # Enable more expensive debug assertions when building for testing purposes pavexc = { path = "../pavexc", features = ["debug_assertions"] } diff --git a/libs/pavex_cli/tests/ui_tests/app_builder/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/app_builder/expectations/app.rs index c4f2c148e..ff5f99679 100644 --- a/libs/pavex_cli/tests/ui_tests/app_builder/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/app_builder/expectations/app.rs @@ -9,7 +9,9 @@ struct ServerState { pub struct ApplicationState { s0: app::HttpClient, } -pub async fn build_application_state(v0: app::Config) -> crate::ApplicationState { +pub async fn build_application_state( + v0: app::Config, +) -> crate::ApplicationState { let v1 = app::http_client(v0); crate::ApplicationState { s0: v1 } } diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/expectations/app.rs index 1995f3799..4322e5803 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/expectations/app.rs @@ -9,7 +9,9 @@ struct ServerState { pub struct ApplicationState { s0: app::HttpClient, } -pub async fn build_application_state(v0: app::Config) -> crate::ApplicationState { +pub async fn build_application_state( + v0: app::Config, +) -> crate::ApplicationState { let v1 = app::http_client(v0).await; crate::ApplicationState { s0: v1 } } diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_return_the_unit_type/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_return_the_unit_type/expectations/stderr.txt index 723896a4d..639cb1b75 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_return_the_unit_type/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_return_the_unit_type/expectations/stderr.txt @@ -4,7 +4,7 @@ β”‚ This request handler doesn't: it returns the unit type, `()`. I can't β”‚ convert `()` into an HTTP response. β”‚ - β”‚ ╭─[src/lib.rs:79:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:79:1] β”‚ 79 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ 80 β”‚ bp.route(GET, "/unit", f!(crate::unit_handler)); β”‚ Β·  ───────────┬─────────── @@ -18,7 +18,7 @@ β”‚ This request handler doesn't: it returns the unit type, `()`, when β”‚ successful. I can't convert `()` into an HTTP response. β”‚ - β”‚ ╭─[src/lib.rs:80:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:80:1] β”‚ 80 β”‚ bp.route(GET, "/unit", f!(crate::unit_handler)); β”‚ 81 β”‚ bp.route(GET, "/fallible_unit", f!(crate::fallible_unit_handler)) β”‚ Β·  ────────────────┬─────────────── @@ -30,7 +30,7 @@ Γ— All constructors must return *something*. β”‚ This constructor doesn't: it returns the unit type, `()`. β”‚ - β”‚ ╭─[src/lib.rs:61:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:61:1] β”‚ 61 β”‚ let mut bp = Blueprint::new(); β”‚ 62 β”‚ bp.singleton(f!(crate::constructor)); β”‚ Β·  ───────────┬────────── @@ -43,7 +43,7 @@ β”‚ This fallible constructor doesn't: it returns the unit type when β”‚ successful, `Ok(())`. β”‚ - β”‚ ╭─[src/lib.rs:62:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:62:1] β”‚ 62 β”‚ bp.singleton(f!(crate::constructor)); β”‚ 63 β”‚ bp.request_scoped(f!(crate::fallible_unit_constructor)); β”‚ Β·  ──────────────────┬───────────────── @@ -57,7 +57,7 @@ β”‚ This middleware doesn't: it returns the unit type, `()`. I can't convert β”‚ `()` into an HTTP response. β”‚ - β”‚ ╭─[src/lib.rs:70:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:70:1] β”‚ 70 β”‚ β”‚ 71 β”‚ bp.wrap(f!(crate::unit_wrapping)); β”‚ Β·  ────────────┬─────────── @@ -71,7 +71,7 @@ β”‚ This middleware doesn't: it returns the unit type, `()`, when successful. β”‚ I can't convert `()` into an HTTP response. β”‚ - β”‚ ╭─[src/lib.rs:71:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:71:1] β”‚ 71 β”‚ bp.wrap(f!(crate::unit_wrapping)); β”‚ 72 β”‚ bp.wrap(f!(crate::fallible_unit_wrapping)) β”‚ Β·  ────────────────┬──────────────── @@ -83,7 +83,7 @@ Γ— Pre-processing middlewares must return `pavex::middleware::Processing`. β”‚ This middleware doesn't: it returns the unit type, `()`. β”‚ - β”‚ ╭─[src/lib.rs:66:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:66:1] β”‚ 66 β”‚ β”‚ 67 β”‚ bp.pre_process(f!(crate::unit_pre)); β”‚ Β·  ─────────┬───────── @@ -96,7 +96,7 @@ β”‚ when successful. β”‚ This middleware doesn't: it returns the unit type, `()`, when successful. β”‚ - β”‚ ╭─[src/lib.rs:67:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:67:1] β”‚ 67 β”‚ bp.pre_process(f!(crate::unit_pre)); β”‚ 68 β”‚ bp.pre_process(f!(crate::fallible_unit_pre)) β”‚ Β·  ──────────────┬───────────── @@ -110,7 +110,7 @@ β”‚ This middleware doesn't: it returns the unit type, `()`. I can't convert β”‚ `()` into an HTTP response. β”‚ - β”‚ ╭─[src/lib.rs:74:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:74:1] β”‚ 74 β”‚ β”‚ 75 β”‚ bp.post_process(f!(crate::unit_post)); β”‚ Β·  ──────────┬───────── @@ -124,7 +124,7 @@ β”‚ This middleware doesn't: it returns the unit type, `()`, when successful. β”‚ I can't convert `()` into an HTTP response. β”‚ - β”‚ ╭─[src/lib.rs:75:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:75:1] β”‚ 75 β”‚ bp.post_process(f!(crate::unit_post)); β”‚ 76 β”‚ bp.post_process(f!(crate::fallible_unit_post)) β”‚ Β·  ──────────────┬────────────── @@ -135,10 +135,10 @@ ERROR: Γ— All error handlers must return a type that implements β”‚ `pavex::response::IntoResponse`. - β”‚ `app::error_handler` doesn't, it returns the unit type, `()`. I can't - β”‚ convert `()` into an HTTP response! + β”‚ `app::error_handler` doesn't, it returns the unit type, `()`. I + β”‚ can't convert `()` into an HTTP response! β”‚ - β”‚ ╭─[src/lib.rs:64:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:64:1] β”‚ 64 β”‚ bp.request_scoped(f!(crate::fallible_constructor)) β”‚ 65 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── @@ -149,10 +149,10 @@ ERROR: Γ— All error handlers must return a type that implements β”‚ `pavex::response::IntoResponse`. - β”‚ `app::error_handler` doesn't, it returns the unit type, `()`. I can't - β”‚ convert `()` into an HTTP response! + β”‚ `app::error_handler` doesn't, it returns the unit type, `()`. I + β”‚ can't convert `()` into an HTTP response! β”‚ - β”‚ ╭─[src/lib.rs:68:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:68:1] β”‚ 68 β”‚ bp.pre_process(f!(crate::fallible_unit_pre)) β”‚ 69 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── @@ -163,10 +163,10 @@ ERROR: Γ— All error handlers must return a type that implements β”‚ `pavex::response::IntoResponse`. - β”‚ `app::error_handler` doesn't, it returns the unit type, `()`. I can't - β”‚ convert `()` into an HTTP response! + β”‚ `app::error_handler` doesn't, it returns the unit type, `()`. I + β”‚ can't convert `()` into an HTTP response! β”‚ - β”‚ ╭─[src/lib.rs:72:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:72:1] β”‚ 72 β”‚ bp.wrap(f!(crate::fallible_unit_wrapping)) β”‚ 73 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── @@ -177,10 +177,10 @@ ERROR: Γ— All error handlers must return a type that implements β”‚ `pavex::response::IntoResponse`. - β”‚ `app::error_handler` doesn't, it returns the unit type, `()`. I can't - β”‚ convert `()` into an HTTP response! + β”‚ `app::error_handler` doesn't, it returns the unit type, `()`. I + β”‚ can't convert `()` into an HTTP response! β”‚ - β”‚ ╭─[src/lib.rs:76:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:76:1] β”‚ 76 β”‚ bp.post_process(f!(crate::fallible_unit_post)) β”‚ 77 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── @@ -191,10 +191,10 @@ ERROR: Γ— All error handlers must return a type that implements β”‚ `pavex::response::IntoResponse`. - β”‚ `app::error_handler` doesn't, it returns the unit type, `()`. I can't - β”‚ convert `()` into an HTTP response! + β”‚ `app::error_handler` doesn't, it returns the unit type, `()`. I + β”‚ can't convert `()` into an HTTP response! β”‚ - β”‚ ╭─[src/lib.rs:81:1] + β”‚ ╭─[blueprint/common/cannot_return_the_unit_type/src/lib.rs:81:1] β”‚ 81 β”‚ bp.route(GET, "/fallible_unit", f!(crate::fallible_unit_handler)) β”‚ 82 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/expectations/stderr.txt index c39b9bca7..955692ef5 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/expectations/stderr.txt @@ -2,14 +2,14 @@ Γ— You can't inject a mutable reference as an input parameter to β”‚ `app::observer`. β”‚ - β”‚ ╭─[src/lib.rs:33:1] + β”‚ ╭─[blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs:33:1] β”‚ 33 β”‚ bp.wrap(f!(crate::wrapping)); β”‚ 34 β”‚ bp.error_observer(f!(crate::observer)); β”‚ Β·  ─────────┬───────── β”‚ Β· ╰── The error observer was registered here β”‚ 35 β”‚ bp.route(GET, "/home", f!(crate::handler)) β”‚ ╰──── - β”‚ ╭─[src/lib.rs:21:1] + β”‚ ╭─[blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs:21:1] β”‚ 21 β”‚ β”‚ 22 β”‚ pub fn observer(e: &pavex::Error, s: &mut String) { β”‚ Β·  ───────┬────── @@ -24,14 +24,14 @@ Γ— You can't inject a mutable reference as an input parameter to β”‚ `app::constructor`. β”‚ - β”‚ ╭─[src/lib.rs:31:1] + β”‚ ╭─[blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs:31:1] β”‚ 31 β”‚ let mut bp = Blueprint::new(); β”‚ 32 β”‚ bp.request_scoped(f!(crate::constructor)); β”‚ Β·  ───────────┬────────── β”‚ Β· ╰── The constructor was registered here β”‚ 33 β”‚ bp.wrap(f!(crate::wrapping)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:6:1] + β”‚ ╭─[blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs:6:1] β”‚ 6 β”‚ β”‚ 7 β”‚ pub fn constructor(r: &mut RequestHead) -> String { β”‚ Β·  ─────────┬───────── @@ -46,14 +46,14 @@ Γ— You can't inject a mutable reference as an input parameter to β”‚ `app::wrapping`. β”‚ - β”‚ ╭─[src/lib.rs:32:1] + β”‚ ╭─[blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs:32:1] β”‚ 32 β”‚ bp.request_scoped(f!(crate::constructor)); β”‚ 33 β”‚ bp.wrap(f!(crate::wrapping)); β”‚ Β·  ─────────┬───────── β”‚ Β· ╰── The wrapping middleware was registered here β”‚ 34 β”‚ bp.error_observer(f!(crate::observer)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:14:1] + β”‚ ╭─[blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs:14:1] β”‚ 14 β”‚ β”‚ 15 β”‚ pub fn wrapping(next: Next, s: &mut String) -> Response β”‚ Β·  ───────┬────── @@ -68,14 +68,14 @@ Γ— You can't inject a mutable reference as an input parameter to β”‚ `app::error_handler`. β”‚ - β”‚ ╭─[src/lib.rs:35:1] + β”‚ ╭─[blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs:35:1] β”‚ 35 β”‚ bp.route(GET, "/home", f!(crate::handler)) β”‚ 36 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── β”‚ Β· The error handler was registered here β”‚ 37 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:10:1] + β”‚ ╭─[blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs:10:1] β”‚ 10 β”‚ β”‚ 11 β”‚ pub fn error_handler(e: &pavex::Error, s: &mut String) -> Response { β”‚ Β·  ───────┬────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/expectations/stderr.txt index e861a9d66..259e9432f 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/expectations/stderr.txt @@ -1,10 +1,11 @@ ERROR: Γ— A type must be clonable if you set its cloning strategy to β”‚ `CloneIfNecessary`. - β”‚ The cloning strategy for `app::singleton` is `CloneIfNecessary`, but - β”‚ `app::A`, its output type, doesn't implement the `Clone` trait. + β”‚ The cloning strategy for `app::singleton` is `CloneIfNecessary`, + β”‚ but `app::A`, its output type, doesn't implement the `Clone` + β”‚ trait. β”‚ - β”‚ ╭─[src/lib.rs:23:1] + β”‚ ╭─[blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs:23:1] β”‚ 23 β”‚ bp.prebuilt(t!(crate::C)).clone_if_necessary(); β”‚ 24 β”‚ bp.singleton(f!(crate::singleton)).clone_if_necessary(); β”‚ Β·  ──────────┬───────── @@ -17,10 +18,11 @@ ERROR: Γ— A type must be clonable if you set its cloning strategy to β”‚ `CloneIfNecessary`. - β”‚ The cloning strategy for `app::request_scoped` is `CloneIfNecessary`, but - β”‚ `app::B`, its output type, doesn't implement the `Clone` trait. + β”‚ The cloning strategy for `app::request_scoped` is + β”‚ `CloneIfNecessary`, but `app::B`, its output type, doesn't + β”‚ implement the `Clone` trait. β”‚ - β”‚ ╭─[src/lib.rs:24:1] + β”‚ ╭─[blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs:24:1] β”‚ 24 β”‚ bp.singleton(f!(crate::singleton)).clone_if_necessary(); β”‚ 25 β”‚ bp.request_scoped(f!(crate::request_scoped)) β”‚ Β·  ────────────┬──────────── @@ -33,10 +35,10 @@ ERROR: Γ— A type must be clonable if you set its cloning strategy to β”‚ `CloneIfNecessary`. - β”‚ The cloning strategy for `app::C`, a prebuilt type, is `CloneIfNecessary`, - β”‚ but it doesn't implement the `Clone` trait. + β”‚ The cloning strategy for `app::C`, a prebuilt type, is + β”‚ `CloneIfNecessary`, but it doesn't implement the `Clone` trait. β”‚ - β”‚ ╭─[src/lib.rs:22:1] + β”‚ ╭─[blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs:22:1] β”‚ 22 β”‚ let mut bp = Blueprint::new(); β”‚ 23 β”‚ bp.prebuilt(t!(crate::C)).clone_if_necessary(); β”‚ Β·  ──────┬───── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/expectations/stderr.txt index 0602e983c..7560cffe0 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/expectations/stderr.txt @@ -1,75 +1,82 @@ ERROR: Γ— I can't generate code that will pass the borrow checker *and* match the β”‚ instructions in your blueprint. - β”‚ `app::handler` consumes `app::A` by value, but `app::A` is a singleton and - β”‚ can't be moved out of `ApplicationState`. - β”‚ Cloning `app::A` would fix this, but its cloning strategy is set to - β”‚ `NeverClone`. + β”‚ `app::handler` consumes `app::A` by value, + β”‚ but `app::A` is a singleton and can't be moved out of + β”‚ `ApplicationState`. + β”‚ Cloning `app::A` would fix this, but its cloning strategy is set + β”‚ to `NeverClone`. β”‚ - β”‚ ╭─[src/lib.rs:28:1] + β”‚ ╭─[blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs:28:1] β”‚ 28 β”‚ bp.prebuilt(t!(crate::B)); β”‚ 29 β”‚ bp.singleton(f!(crate::singleton)); β”‚ Β·  ──────────┬───────── β”‚ Β· ╰── It was registered here β”‚ 30 β”‚ bp.singleton(f!(crate::singleton2)); β”‚ ╰──── - β”‚ help: Can `app::handler` take a reference to `app::A`, rather than consuming - β”‚ it by value? - β”‚  help: Set the cloning strategy for `app::A` to `CloneIfNecessary`. + β”‚ help: Can `app::handler` take a reference to `app::A`, + β”‚ rather than consuming it by value? + β”‚  help: Set the cloning strategy for `app::A` to + β”‚ `CloneIfNecessary`. ERROR: Γ— I can't generate code that will pass the borrow checker *and* match the β”‚ instructions in your blueprint. - β”‚ `app::handler` consumes `app::B` by value, but `app::B` is a singleton and - β”‚ can't be moved out of `ApplicationState`. - β”‚ Cloning `app::B` would fix this, but its cloning strategy is set to - β”‚ `NeverClone`. + β”‚ `app::handler` consumes `app::B` by value, + β”‚ but `app::B` is a singleton and can't be moved out of + β”‚ `ApplicationState`. + β”‚ Cloning `app::B` would fix this, but its cloning strategy is set + β”‚ to `NeverClone`. β”‚ - β”‚ ╭─[src/lib.rs:27:1] + β”‚ ╭─[blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs:27:1] β”‚ 27 β”‚ let mut bp = Blueprint::new(); β”‚ 28 β”‚ bp.prebuilt(t!(crate::B)); β”‚ Β·  ──────┬───── β”‚ Β· ╰── It was registered here β”‚ 29 β”‚ bp.singleton(f!(crate::singleton)); β”‚ ╰──── - β”‚ help: Can `app::handler` take a reference to `app::B`, rather than consuming - β”‚ it by value? - β”‚  help: Set the cloning strategy for `app::B` to `CloneIfNecessary`. + β”‚ help: Can `app::handler` take a reference to `app::B`, + β”‚ rather than consuming it by value? + β”‚  help: Set the cloning strategy for `app::B` to + β”‚ `CloneIfNecessary`. ERROR: Γ— I can't generate code that will pass the borrow checker *and* match the β”‚ instructions in your blueprint. - β”‚ `app::handler` consumes `app::C` by value, but `app::C` is a singleton and - β”‚ can't be moved out of `ApplicationState`. - β”‚ Cloning `app::C` would fix this, but its cloning strategy is set to - β”‚ `NeverClone`. + β”‚ `app::handler` consumes `app::C` by value, + β”‚ but `app::C` is a singleton and can't be moved out of + β”‚ `ApplicationState`. + β”‚ Cloning `app::C` would fix this, but its cloning strategy is set + β”‚ to `NeverClone`. β”‚ - β”‚ ╭─[src/lib.rs:29:1] + β”‚ ╭─[blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs:29:1] β”‚ 29 β”‚ bp.singleton(f!(crate::singleton)); β”‚ 30 β”‚ bp.singleton(f!(crate::singleton2)); β”‚ Β·  ──────────┬────────── β”‚ Β· ╰── It was registered here β”‚ 31 β”‚ bp.route(GET, "/", f!(crate::handler)); β”‚ ╰──── - β”‚ help: Can `app::handler` take a reference to `app::C`, rather than consuming - β”‚ it by value? - β”‚  help: Set the cloning strategy for `app::C` to `CloneIfNecessary`. + β”‚ help: Can `app::handler` take a reference to `app::C`, + β”‚ rather than consuming it by value? + β”‚  help: Set the cloning strategy for `app::C` to + β”‚ `CloneIfNecessary`. ERROR: Γ— I can't generate code that will pass the borrow checker *and* match the β”‚ instructions in your blueprint. - β”‚ There are 2 components that take `app::B` as an input parameter, consuming - β”‚ it by value: + β”‚ There are 2 components that take `app::B` as an input parameter, + β”‚ consuming it by value: β”‚ - `crate::ApplicationState` β”‚ - `app::singleton2`, a constructor - β”‚ Since I'm not allowed to clone `app::B`, I can't resolve this conflict. + β”‚ Since I'm not allowed to clone `app::B`, I can't resolve this + β”‚ conflict. β”‚ β”‚ β”‚ help: Considering changing the signature of the components that consume β”‚ `app::B` by value. β”‚ Would a shared reference, `&app::B`, be enough? β”‚ ☞ - β”‚ ╭─[src/lib.rs:29:1] + β”‚ ╭─[blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs:29:1] β”‚ 29 β”‚ bp.singleton(f!(crate::singleton)); β”‚ 30 β”‚ bp.singleton(f!(crate::singleton2)); β”‚ Β·  ──────────┬────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/output_type_must_implement_into_response/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/common/output_type_must_implement_into_response/expectations/stderr.txt index d4e265d11..335379608 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/common/output_type_must_implement_into_response/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/common/output_type_must_implement_into_response/expectations/stderr.txt @@ -3,7 +3,7 @@ β”‚ response. β”‚ It doesn't implement `pavex::response::IntoResponse`. β”‚ - β”‚ ╭─[src/lib.rs:43:1] + β”‚ ╭─[blueprint/common/output_type_must_implement_into_response/src/lib.rs:43:1] β”‚ 43 β”‚ .error_handler(f!(crate::error_handler)); β”‚ 44 β”‚ bp.route(GET, "/home", f!(crate::handler)) β”‚ Β·  ─────────┬──────── @@ -18,7 +18,7 @@ β”‚ HTTP response. β”‚ It doesn't implement `pavex::response::IntoResponse`. β”‚ - β”‚ ╭─[src/lib.rs:37:1] + β”‚ ╭─[blueprint/common/output_type_must_implement_into_response/src/lib.rs:37:1] β”‚ 37 β”‚ let mut bp = Blueprint::new(); β”‚ 38 β”‚ bp.wrap(f!(crate::wrapping_middleware)) β”‚ Β·  ───────────────┬────────────── @@ -33,7 +33,7 @@ β”‚ an HTTP response. β”‚ It doesn't implement `pavex::response::IntoResponse`. β”‚ - β”‚ ╭─[src/lib.rs:39:1] + β”‚ ╭─[blueprint/common/output_type_must_implement_into_response/src/lib.rs:39:1] β”‚ 39 β”‚ .error_handler(f!(crate::error_handler)); β”‚ 40 β”‚ bp.post_process(f!(crate::pp_middleware)) β”‚ Β·  ────────────┬─────────── @@ -48,7 +48,7 @@ β”‚ response. β”‚ It doesn't implement `pavex::response::IntoResponse`. β”‚ - β”‚ ╭─[src/lib.rs:38:1] + β”‚ ╭─[blueprint/common/output_type_must_implement_into_response/src/lib.rs:38:1] β”‚ 38 β”‚ bp.wrap(f!(crate::wrapping_middleware)) β”‚ 39 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── @@ -63,7 +63,7 @@ β”‚ response. β”‚ It doesn't implement `pavex::response::IntoResponse`. β”‚ - β”‚ ╭─[src/lib.rs:40:1] + β”‚ ╭─[blueprint/common/output_type_must_implement_into_response/src/lib.rs:40:1] β”‚ 40 β”‚ bp.post_process(f!(crate::pp_middleware)) β”‚ 41 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── @@ -78,7 +78,7 @@ β”‚ response. β”‚ It doesn't implement `pavex::response::IntoResponse`. β”‚ - β”‚ ╭─[src/lib.rs:42:1] + β”‚ ╭─[blueprint/common/output_type_must_implement_into_response/src/lib.rs:42:1] β”‚ 42 β”‚ bp.request_scoped(f!(crate::request_scoped)) β”‚ 43 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── @@ -93,7 +93,7 @@ β”‚ response. β”‚ It doesn't implement `pavex::response::IntoResponse`. β”‚ - β”‚ ╭─[src/lib.rs:44:1] + β”‚ ╭─[blueprint/common/output_type_must_implement_into_response/src/lib.rs:44:1] β”‚ 44 β”‚ bp.route(GET, "/home", f!(crate::handler)) β”‚ 45 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/stderr.txt index 92d6ff3c2..cc4b42f7f 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/stderr.txt @@ -1,9 +1,10 @@ WARNING: - ⚠ You registered a constructor for `app::Unused`, but it's never used. - β”‚ `app::Unused::new` is never invoked since no component is asking for - β”‚ `app::Unused` to be injected as one of its inputs. + ⚠ You registered a constructor for `app::Unused`, but it's never + β”‚ used. + β”‚ `app::Unused::new` is never invoked since no component is asking + β”‚ for `app::Unused` to be injected as one of its inputs. β”‚ - β”‚ ╭─[src/lib.rs:13:1] + β”‚ ╭─[blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src/lib.rs:13:1] β”‚ 13 β”‚ let mut bp = Blueprint::new(); β”‚ 14 β”‚ bp.request_scoped(f!(crate::Unused::new)); β”‚ Β·  ───────────┬────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/expectations/stderr.txt index b07c98c37..f8954f74d 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/expectations/stderr.txt @@ -5,14 +5,14 @@ β”‚ in the output type returned by the constructor. This is not the case for β”‚ `T`, since it is only used by the input parameters. β”‚ - β”‚ ╭─[src/lib.rs:19:1] + β”‚ ╭─[blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/lib.rs:19:1] β”‚ 19 β”‚ let mut bp = Blueprint::new(); β”‚ 20 β”‚ Constructor::new(f!(crate::generic_constructor), Lifecycle::RequestScoped).register(&mut bp); β”‚ Β·  ───────────────┬────────────── β”‚ Β· ╰── The constructor was registered here β”‚ 21 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:9:1] + β”‚ ╭─[blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/lib.rs:9:1] β”‚  9 β”‚ β”‚ 10 β”‚ pub fn generic_constructor(generic_input: GenericType) -> u8 { β”‚ Β·  ┬ ─┬ diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/expectations/stderr.txt index ee0822a47..5bf1ce4d0 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/expectations/stderr.txt @@ -5,14 +5,14 @@ β”‚ in the output type returned by the constructor. This is not the case for β”‚ `T`, since it is only used by the input parameters. β”‚ - β”‚ ╭─[src/lib.rs:27:1] + β”‚ ╭─[blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs:27:1] β”‚ 27 β”‚ let mut bp = Blueprint::new(); β”‚ 28 β”‚ bp.request_scoped(f!(crate::generic_constructor)); β”‚ Β·  ───────────────┬────────────── β”‚ Β· The constructor was registered here β”‚ 29 β”‚ bp.request_scoped(f!(crate::doubly_generic_constructor)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:5:1] + β”‚ ╭─[blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs:5:1] β”‚ 5 β”‚ β”‚ 6 β”‚ pub fn generic_constructor(generic_input: GenericType) -> u8 { β”‚ Β·  ┬ ─┬ @@ -34,14 +34,14 @@ β”‚ in the output type returned by the constructor. This is not the case for β”‚ `T` and `S`, since they are only used by the input parameters. β”‚ - β”‚ ╭─[src/lib.rs:28:1] + β”‚ ╭─[blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs:28:1] β”‚ 28 β”‚ bp.request_scoped(f!(crate::generic_constructor)); β”‚ 29 β”‚ bp.request_scoped(f!(crate::doubly_generic_constructor)); β”‚ Β·  ──────────────────┬────────────────── β”‚ Β· The constructor was registered here ──╯ β”‚ 30 β”‚ bp.request_scoped(f!(crate::triply_generic_constructor)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:9:1] + β”‚ ╭─[blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs:9:1] β”‚  9 β”‚ β”‚ 10 β”‚ pub fn doubly_generic_constructor(i1: GenericType, i2: GenericType) -> u16 { β”‚ Β·  ┬ ┬ ─┬─ @@ -64,14 +64,14 @@ β”‚ in the output type returned by the constructor. This is not the case for β”‚ `T`, `S` and `U`, since they are only used by the input parameters. β”‚ - β”‚ ╭─[src/lib.rs:29:1] + β”‚ ╭─[blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs:29:1] β”‚ 29 β”‚ bp.request_scoped(f!(crate::doubly_generic_constructor)); β”‚ 30 β”‚ bp.request_scoped(f!(crate::triply_generic_constructor)); β”‚ Β·  ──────────────────┬────────────────── β”‚ Β· The constructor was registered here ──╯ β”‚ 31 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:13:1] + β”‚ ╭─[blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs:13:1] β”‚ 13 β”‚ β”‚ 14 β”‚ pub fn triply_generic_constructor( β”‚ Β·  ┬ ┬ ┬ diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/expectations/stderr.txt index ef75241f4..ddc6ab10c 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/expectations/stderr.txt @@ -1,19 +1,19 @@ ERROR: - Γ— You can't return a naked generic parameter from a constructor, like `T` - β”‚ in `app::naked`. + Γ— You can't return a naked generic parameter from a constructor, like `T` in + β”‚ `app::naked`. β”‚ I don't take into account trait bounds when building your dependency β”‚ graph. A constructor that returns a naked generic parameter is equivalent, β”‚ in my eyes, to a constructor that can build **any** type, which is β”‚ unlikely to be what you want! β”‚ - β”‚ ╭─[src/lib.rs:23:1] + β”‚ ╭─[blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs:23:1] β”‚ 23 β”‚ let mut bp = Blueprint::new(); β”‚ 24 β”‚ bp.request_scoped(f!(crate::naked)); β”‚ Β·  ────────┬─────── β”‚ Β· ╰── The constructor was registered here β”‚ 25 β”‚ bp.request_scoped(f!(crate::fallible_naked)) β”‚ ╰──── - β”‚ ╭─[src/lib.rs:1:1] + β”‚ ╭─[blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs:1:1] β”‚ 1 β”‚ pub fn naked() -> T { β”‚ Β·  ┬ β”‚ Β· ╰── The invalid output type @@ -31,14 +31,14 @@ β”‚ in my eyes, to a constructor that can build **any** type, which is β”‚ unlikely to be what you want! β”‚ - β”‚ ╭─[src/lib.rs:24:1] + β”‚ ╭─[blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs:24:1] β”‚ 24 β”‚ bp.request_scoped(f!(crate::naked)); β”‚ 25 β”‚ bp.request_scoped(f!(crate::fallible_naked)) β”‚ Β·  ────────────┬──────────── β”‚ Β· ╰── The constructor was registered here β”‚ 26 β”‚ .error_handler(f!(crate::error_handler)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:1:1] + β”‚ ╭─[blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs:1:1] β”‚ 1 β”‚ pub fn fallible_naked() -> Result { β”‚ Β·  ────────────┬─────────── β”‚ Β· ╰── The invalid output type diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/expectations/stderr.txt index 779b4f0f7..059c27d12 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/expectations/stderr.txt @@ -1,7 +1,8 @@ ERROR: - Γ— `app::NonSendSingleton` doesn't implement the `core::marker::Send` trait. + Γ— `app::NonSendSingleton` doesn't implement the + β”‚ `core::marker::Send` trait. β”‚ - β”‚ ╭─[src/lib.rs:39:1] + β”‚ ╭─[blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs:39:1] β”‚ 39 β”‚ let mut bp = Blueprint::new(); β”‚ 40 β”‚ bp.singleton(f!(crate::NonSendSingleton::new)); β”‚ Β·  ────────────────┬─────────────── @@ -13,9 +14,10 @@ β”‚ is shared across all worker threads. ERROR: - Γ— `app::NonSendSingleton` doesn't implement the `core::marker::Sync` trait. + Γ— `app::NonSendSingleton` doesn't implement the + β”‚ `core::marker::Sync` trait. β”‚ - β”‚ ╭─[src/lib.rs:39:1] + β”‚ ╭─[blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs:39:1] β”‚ 39 β”‚ let mut bp = Blueprint::new(); β”‚ 40 β”‚ bp.singleton(f!(crate::NonSendSingleton::new)); β”‚ Β·  ────────────────┬─────────────── @@ -27,9 +29,10 @@ β”‚ is shared across all worker threads. ERROR: - Γ— `app::NonSyncSingleton` doesn't implement the `core::marker::Sync` trait. + Γ— `app::NonSyncSingleton` doesn't implement the + β”‚ `core::marker::Sync` trait. β”‚ - β”‚ ╭─[src/lib.rs:40:1] + β”‚ ╭─[blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs:40:1] β”‚ 40 β”‚ bp.singleton(f!(crate::NonSendSingleton::new)); β”‚ 41 β”‚ bp.singleton(f!(crate::NonSyncSingleton::new)); β”‚ Β·  ────────────────┬─────────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/expectations/stderr.txt index d3f1a7feb..4e01c8d8b 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/expectations/stderr.txt @@ -2,7 +2,7 @@ Γ— You registered an error handler for a constructor that doesn't return β”‚ a `Result`. β”‚ - β”‚ ╭─[src/lib.rs:23:1] + β”‚ ╭─[blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/lib.rs:23:1] β”‚ 23 β”‚ bp.constructor(f!(crate::infallible_constructor), Lifecycle::RequestScoped) β”‚ 24 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/expectations/stderr.txt index d3f1a7feb..e6e9872ee 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/expectations/stderr.txt @@ -2,7 +2,7 @@ Γ— You registered an error handler for a constructor that doesn't return β”‚ a `Result`. β”‚ - β”‚ ╭─[src/lib.rs:23:1] + β”‚ ╭─[blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/lib.rs:23:1] β”‚ 23 β”‚ bp.constructor(f!(crate::infallible_constructor), Lifecycle::RequestScoped) β”‚ 24 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/expectations/stderr.txt index 13da55d3a..14548aafb 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/expectations/stderr.txt @@ -2,14 +2,14 @@ Γ— Error handlers must be infallible. β”‚ `app::error_handler` isn't, it returns a `Result`! β”‚ - β”‚ ╭─[src/lib.rs:15:1] + β”‚ ╭─[blueprint/error_handlers/error_handlers_cannot_be_fallible/src/lib.rs:15:1] β”‚ 15 β”‚ bp.route(GET, "/home", f!(crate::handler)) β”‚ 16 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── β”‚ Β· The error handler was registered here β”‚ 17 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:4:1] + β”‚ ╭─[blueprint/error_handlers/error_handlers_cannot_be_fallible/src/lib.rs:4:1] β”‚ 4 β”‚ β”‚ 5 β”‚ pub fn error_handler(e: &pavex::Error) -> Result { β”‚ Β·  ────────────┬─────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/expectations/stderr.txt index d2461194f..afde3ed56 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/expectations/stderr.txt @@ -1,10 +1,11 @@ ERROR: Γ— Error handlers associated with a fallible operation must take a reference β”‚ to the operation's error type as input. - β”‚ This error handler is associated with `app::fallible_constructor`, - β”‚ therefore I expect `&app::Error` to be one of its input parameters. + β”‚ This error handler is associated with + β”‚ `app::fallible_constructor`, therefore I expect + β”‚ `&app::Error` to be one of its input parameters. β”‚ - β”‚ ╭─[src/lib.rs:22:1] + β”‚ ╭─[blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/lib.rs:22:1] β”‚ 22 β”‚ bp.constructor(f!(crate::fallible_constructor), Lifecycle::RequestScoped) β”‚ 23 β”‚ .error_handler(f!(crate::error_handler)); β”‚ Β·  ────────────┬─────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/expectations/stderr.txt index 46e60a8d2..f9536ef23 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/expectations/stderr.txt @@ -5,14 +5,14 @@ β”‚ in the error type processed by this error handler. This is not the case β”‚ for `T`, since it isn't used by the error type. β”‚ - β”‚ ╭─[src/lib.rs:53:1] + β”‚ ╭─[blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs:53:1] β”‚ 53 β”‚ bp.constructor(f!(crate::constructor1), Lifecycle::RequestScoped) β”‚ 54 β”‚ .error_handler(f!(crate::generic_error_handler)); β”‚ Β·  ────────────────┬─────────────── β”‚ Β· The error handler was registered here β”‚ 55 β”‚ bp.constructor(f!(crate::constructor2), Lifecycle::RequestScoped) β”‚ ╰──── - β”‚ ╭─[src/lib.rs:24:1] + β”‚ ╭─[blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs:24:1] β”‚ 24 β”‚ β”‚ 25 β”‚ pub fn generic_error_handler(error: &Error, generic_input: GenericType) -> Response { β”‚ Β·  ┬ ──────┬────── @@ -34,14 +34,14 @@ β”‚ in the error type processed by this error handler. This is not the case β”‚ for `T` and `S`, since they aren't used by the error type. β”‚ - β”‚ ╭─[src/lib.rs:55:1] + β”‚ ╭─[blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs:55:1] β”‚ 55 β”‚ bp.constructor(f!(crate::constructor2), Lifecycle::RequestScoped) β”‚ 56 β”‚ .error_handler(f!(crate::doubly_generic_error_handler)); β”‚ Β·  ───────────────────┬─────────────────── β”‚ Β· The error handler was registered here ──╯ β”‚ 57 β”‚ bp.constructor(f!(crate::constructor3), Lifecycle::Transient) β”‚ ╰──── - β”‚ ╭─[src/lib.rs:28:1] + β”‚ ╭─[blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs:28:1] β”‚ 28 β”‚ β”‚ 29 β”‚ pub fn doubly_generic_error_handler( β”‚ Β·  ┬ ┬ @@ -66,14 +66,14 @@ β”‚ in the error type processed by this error handler. This is not the case β”‚ for `T`, `S` and `U`, since they aren't used by the error type. β”‚ - β”‚ ╭─[src/lib.rs:57:1] + β”‚ ╭─[blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs:57:1] β”‚ 57 β”‚ bp.constructor(f!(crate::constructor3), Lifecycle::Transient) β”‚ 58 β”‚ .error_handler(f!(crate::triply_generic_error_handler)); β”‚ Β·  ───────────────────┬─────────────────── β”‚ Β· The error handler was registered here ──╯ β”‚ 59 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:36:1] + β”‚ ╭─[blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs:36:1] β”‚ 36 β”‚ β”‚ 37 β”‚ pub fn triply_generic_error_handler( β”‚ Β·  ┬ ┬ ┬ diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/expectations/stderr.txt index 1c47e8926..6d0211320 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/expectations/stderr.txt @@ -3,14 +3,14 @@ β”‚ register an error observer, I can't infer them. β”‚ `app::generic` has 1 unassigned generic parameters. β”‚ - β”‚ ╭─[src/lib.rs:20:1] + β”‚ ╭─[blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs:20:1] β”‚ 20 β”‚ let mut bp = Blueprint::new(); β”‚ 21 β”‚ bp.error_observer(f!(crate::generic)); β”‚ Β·  ─────────┬──────── β”‚ Β· ╰── The error observer was registered here β”‚ 22 β”‚ bp.error_observer(f!(crate::generic2)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:6:1] + β”‚ ╭─[blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs:6:1] β”‚ 6 β”‚ β”‚ 7 β”‚ pub fn generic(generic_input: GenericType, e: &Error) { β”‚ Β·  ┬ @@ -26,14 +26,14 @@ β”‚ register an error observer, I can't infer them. β”‚ `app::generic2` has 2 unassigned generic parameters. β”‚ - β”‚ ╭─[src/lib.rs:21:1] + β”‚ ╭─[blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs:21:1] β”‚ 21 β”‚ bp.error_observer(f!(crate::generic)); β”‚ 22 β”‚ bp.error_observer(f!(crate::generic2)); β”‚ Β·  ─────────┬───────── β”‚ Β· ╰── The error observer was registered here β”‚ 23 β”‚ bp.error_observer(f!(crate::generic3)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:10:1] + β”‚ ╭─[blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs:10:1] β”‚ 10 β”‚ β”‚ 11 β”‚ pub fn generic2(i1: GenericType, i2: GenericType, e: &Error) { β”‚ Β·  ┬ ┬ @@ -50,14 +50,14 @@ β”‚ register an error observer, I can't infer them. β”‚ `app::generic3` has 3 unassigned generic parameters. β”‚ - β”‚ ╭─[src/lib.rs:22:1] + β”‚ ╭─[blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs:22:1] β”‚ 22 β”‚ bp.error_observer(f!(crate::generic2)); β”‚ 23 β”‚ bp.error_observer(f!(crate::generic3)); β”‚ Β·  ─────────┬───────── β”‚ Β· ╰── The error observer was registered here β”‚ 24 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:14:1] + β”‚ ╭─[blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs:14:1] β”‚ 14 β”‚ β”‚ 15 β”‚ pub fn generic3(i1: GenericType, i2: GenericType, i3: GenericType, e: &Error) { β”‚ Β·  ┬ ┬ ┬ diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/expectations/stderr.txt index 8631ea83a..103d54d6e 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/expectations/stderr.txt @@ -2,7 +2,7 @@ Γ— Error observers must have no return type. β”‚ `app::error_observer` returns `alloc::string::String`. β”‚ - β”‚ ╭─[src/lib.rs:9:1] + β”‚ ╭─[blueprint/error_observers/error_observers_must_return_the_unit_type/src/lib.rs:9:1] β”‚  9 β”‚ let mut bp = Blueprint::new(); β”‚ 10 β”‚ bp.error_observer(f!(crate::error_observer)); β”‚ Β·  ────────────┬──────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/expectations/stderr.txt index 8406da6a7..d6bf9198e 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/expectations/stderr.txt @@ -3,7 +3,7 @@ β”‚ input (`&pavex::Error`). β”‚ `app::error_observer` doesn't. β”‚ - β”‚ ╭─[src/lib.rs:9:1] + β”‚ ╭─[blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src/lib.rs:9:1] β”‚  9 β”‚ let mut bp = Blueprint::new(); β”‚ 10 β”‚ bp.error_observer(f!(crate::error_observer)); β”‚ Β·  ────────────┬──────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/expectations/stderr.txt index a8f57bab9..78dad0d64 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/expectations/stderr.txt @@ -7,7 +7,7 @@ β”‚ them explicitly in the paths of the routes registered against the nested β”‚ blueprint. β”‚ - β”‚ ╭─[src/lib.rs:12:1] + β”‚ ╭─[blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs:12:1] β”‚ 12 β”‚ // If the prefix is not empty, it **cannot** end with a `/` β”‚ 13 β”‚ bp.nest_at("/api/", sub_blueprint()); β”‚ Β·  ───┬─── @@ -21,7 +21,7 @@ Γ— The path prefix passed to `nest_at` must begin with a forward slash, `/`. β”‚ `api` doesn't. β”‚ - β”‚ ╭─[src/lib.rs:10:1] + β”‚ ╭─[blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs:10:1] β”‚ 10 β”‚ // If the prefix is not empty, it **must** start with a `/` β”‚ 11 β”‚ bp.nest_at("api", sub_blueprint()); β”‚ Β·  ──┬── @@ -34,7 +34,7 @@ ERROR: Γ— The path prefix passed to `nest_at` cannot be empty. β”‚ - β”‚ ╭─[src/lib.rs:8:1] + β”‚ ╭─[blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs:8:1] β”‚  8 β”‚ // The prefix cannot be empty β”‚  9 β”‚ bp.nest_at("", sub_blueprint()); β”‚ Β·  ─┬ diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/expectations/stderr.txt index 9dcd62117..c7a4fe98a 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/expectations/stderr.txt @@ -6,14 +6,14 @@ β”‚ that unique instance! β”‚ I have found 2 different constructors for `u64`: β”‚ - β”‚ ╭─[src/lib.rs:8:1] + β”‚ ╭─[blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs:8:1] β”‚  8 β”‚ let mut bp = Blueprint::new(); β”‚  9 β”‚ bp.constructor(f!(crate::singleton), Lifecycle::Singleton); β”‚ Β·  ──────────┬───────── β”‚ Β· ╰── A constructor was registered here β”‚ 10 β”‚ bp.route(GET, "/parent", f!(crate::handler)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:28:1] + β”‚ ╭─[blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs:28:1] β”‚ 28 β”‚ let mut bp = Blueprint::new(); β”‚ 29 β”‚ bp.constructor(f!(crate::overridden_singleton), Lifecycle::Singleton); β”‚ Β·  ───────────────┬─────────────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/expectations/stderr.txt index 555dc3e82..caa8b680f 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/expectations/stderr.txt @@ -6,14 +6,14 @@ β”‚ instance across all those nested blueprints, or do you want to create a β”‚ new instance for each nested blueprint? β”‚ - β”‚ ╭─[src/lib.rs:8:1] + β”‚ ╭─[blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs:8:1] β”‚  8 β”‚ let mut bp = Blueprint::new(); β”‚  9 β”‚ bp.constructor(f!(crate::singleton), Lifecycle::Singleton); β”‚ Β·  ──────────┬───────── β”‚ Β· ╰── A constructor was registered here β”‚ 10 β”‚ bp.route(GET, "/parent", f!(crate::handler)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:24:1] + β”‚ ╭─[blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs:24:1] β”‚ 24 β”‚ let mut bp = Blueprint::new(); β”‚ 25 β”‚ bp.constructor(f!(crate::singleton), Lifecycle::Singleton); β”‚ Β·  ──────────┬───────── @@ -24,7 +24,7 @@ β”‚ for `u64` until there is only one left. It should be attached to a β”‚ blueprint that is a parent of all the nested ones that need to use it. β”‚ ☞ - β”‚ ╭─[src/lib.rs:7:1] + β”‚ ╭─[blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs:7:1] β”‚ 7 β”‚ pub fn blueprint() -> Blueprint { β”‚ 8 β”‚ let mut bp = Blueprint::new(); β”‚ Β·  ────────┬─────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/expectations/stderr.txt index dcbda49da..bae1c7071 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/expectations/stderr.txt @@ -3,14 +3,14 @@ β”‚ I need an instance of `u64` to invoke your request handler, β”‚ `app::handler`. β”‚ - β”‚ ╭─[src/lib.rs:9:1] + β”‚ ╭─[blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs:9:1] β”‚  9 β”‚ bp.nest(sub_blueprint()); β”‚ 10 β”‚ bp.route(GET, "/parent", f!(crate::handler)); β”‚ Β·  ─────────┬──────── β”‚ Β· The request handler was registered here β”‚ 11 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:25:1] + β”‚ ╭─[blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs:25:1] β”‚ 25 β”‚ β”‚ 26 β”‚ pub fn handler(_x: u64, _y: u32, _z: u16) -> StatusCode { β”‚ Β·  ───┬─── @@ -27,14 +27,14 @@ β”‚ I need an instance of `u32` to invoke your request handler, β”‚ `app::handler`. β”‚ - β”‚ ╭─[src/lib.rs:9:1] + β”‚ ╭─[blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs:9:1] β”‚  9 β”‚ bp.nest(sub_blueprint()); β”‚ 10 β”‚ bp.route(GET, "/parent", f!(crate::handler)); β”‚ Β·  ─────────┬──────── β”‚ Β· The request handler was registered here β”‚ 11 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:25:1] + β”‚ ╭─[blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs:25:1] β”‚ 25 β”‚ β”‚ 26 β”‚ pub fn handler(_x: u64, _y: u32, _z: u16) -> StatusCode { β”‚ Β·  ───┬─── @@ -51,14 +51,14 @@ β”‚ I need an instance of `u16` to invoke your request handler, β”‚ `app::handler`. β”‚ - β”‚ ╭─[src/lib.rs:9:1] + β”‚ ╭─[blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs:9:1] β”‚  9 β”‚ bp.nest(sub_blueprint()); β”‚ 10 β”‚ bp.route(GET, "/parent", f!(crate::handler)); β”‚ Β·  ─────────┬──────── β”‚ Β· The request handler was registered here β”‚ 11 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:25:1] + β”‚ ╭─[blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs:25:1] β”‚ 25 β”‚ β”‚ 26 β”‚ pub fn handler(_x: u64, _y: u32, _z: u16) -> StatusCode { β”‚ Β·  ───┬─── @@ -68,4 +68,4 @@ β”‚ help: Register a constructor for `u16`. β”‚  help: Alternatively, use `Blueprint::prebuilt` to add a β”‚ new input parameter of type `u16` to the (generated) - β”‚ `build_application_state`. + β”‚ `build_application_state`. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/expectations/stderr.txt index b3ad183f1..0bb23260c 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/expectations/stderr.txt @@ -3,7 +3,7 @@ β”‚ `pavex::response::Response` as input parameter. β”‚ This middleware does. β”‚ - β”‚ ╭─[src/lib.rs:14:1] + β”‚ ╭─[blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/lib.rs:14:1] β”‚ 14 β”‚ let mut bp = Blueprint::new(); β”‚ 15 β”‚ bp.post_process(f!(crate::mw)); β”‚ Β·  ──────┬────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/expectations/stderr.txt index e4c8a2572..4b7893e9a 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/expectations/stderr.txt @@ -3,7 +3,7 @@ β”‚ `pavex::response::Response` as one of their input parameters. β”‚ This middleware doesn't. β”‚ - β”‚ ╭─[src/lib.rs:14:1] + β”‚ ╭─[blueprint/post_processing_middlewares/must_take_response_as_input/src/lib.rs:14:1] β”‚ 14 β”‚ let mut bp = Blueprint::new(); β”‚ 15 β”‚ bp.post_process(f!(crate::mw)); β”‚ Β·  ──────┬────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt index a3718d87f..a92c0102e 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt @@ -4,14 +4,14 @@ β”‚ There should no unassigned generic parameters in post-processing β”‚ middlewares, but `T` does not seem to have been assigned a concrete type. β”‚ - β”‚ ╭─[src/lib.rs:34:1] + β”‚ ╭─[blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:34:1] β”‚ 34 β”‚ let mut bp = Blueprint::new(); β”‚ 35 β”‚ bp.post_process(f!(crate::generic)); β”‚ Β·  ─────────┬──────── β”‚ Β· The post-processing middleware was registered here β”‚ 36 β”‚ bp.post_process(f!(crate::doubly_generic)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:7:1] + β”‚ ╭─[blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:7:1] β”‚ 7 β”‚ β”‚ 8 β”‚ pub fn generic(_response: Response, generic_input: GenericType) -> Response { β”‚ Β·  ┬ @@ -31,14 +31,14 @@ β”‚ middlewares, but `T` and `S` do not seem to have been assigned a concrete β”‚ type. β”‚ - β”‚ ╭─[src/lib.rs:35:1] + β”‚ ╭─[blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:35:1] β”‚ 35 β”‚ bp.post_process(f!(crate::generic)); β”‚ 36 β”‚ bp.post_process(f!(crate::doubly_generic)); β”‚ Β·  ────────────┬──────────── β”‚ Β· The post-processing middleware was registered here β”‚ 37 β”‚ bp.post_process(f!(crate::triply_generic)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:11:1] + β”‚ ╭─[blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:11:1] β”‚ 11 β”‚ β”‚ 12 β”‚ pub fn doubly_generic( β”‚ Β·  ┬ ┬ @@ -59,14 +59,14 @@ β”‚ middlewares, but `T`, `S` and `U` do not seem to have been assigned a β”‚ concrete type. β”‚ - β”‚ ╭─[src/lib.rs:36:1] + β”‚ ╭─[blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:36:1] β”‚ 36 β”‚ bp.post_process(f!(crate::doubly_generic)); β”‚ 37 β”‚ bp.post_process(f!(crate::triply_generic)); β”‚ Β·  ────────────┬──────────── β”‚ Β· The post-processing middleware was registered here β”‚ 38 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:19:1] + β”‚ ╭─[blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:19:1] β”‚ 19 β”‚ β”‚ 20 β”‚ pub fn triply_generic( β”‚ Β·  ┬ ┬ ┬ diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt index 6d8d3db16..b0c51adf6 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt @@ -3,14 +3,14 @@ β”‚ middlewares, but `T` does not seem to have been assigned a concrete type β”‚ in `app::generic`. β”‚ - β”‚ ╭─[src/lib.rs:29:1] + β”‚ ╭─[blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:29:1] β”‚ 29 β”‚ let mut bp = Blueprint::new(); β”‚ 30 β”‚ bp.pre_process(f!(crate::generic)); β”‚ Β·  ─────────┬──────── β”‚ Β· The pre-processing middleware was registered here β”‚ 31 β”‚ bp.pre_process(f!(crate::doubly_generic)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:7:1] + β”‚ ╭─[blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:7:1] β”‚ 7 β”‚ β”‚ 8 β”‚ pub fn generic(generic_input: GenericType) -> Processing { β”‚ Β·  ┬ @@ -28,14 +28,14 @@ β”‚ middlewares, but `T` and `S` do not seem to have been assigned a concrete β”‚ type in `app::doubly_generic`. β”‚ - β”‚ ╭─[src/lib.rs:30:1] + β”‚ ╭─[blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:30:1] β”‚ 30 β”‚ bp.pre_process(f!(crate::generic)); β”‚ 31 β”‚ bp.pre_process(f!(crate::doubly_generic)); β”‚ Β·  ────────────┬──────────── β”‚ Β· The pre-processing middleware was registered here β”‚ 32 β”‚ bp.pre_process(f!(crate::triply_generic)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:11:1] + β”‚ ╭─[blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:11:1] β”‚ 11 β”‚ β”‚ 12 β”‚ pub fn doubly_generic(i1: GenericType, i2: GenericType) -> Processing { β”‚ Β·  ┬ ┬ @@ -54,14 +54,14 @@ β”‚ middlewares, but `T`, `S` and `U` do not seem to have been assigned a β”‚ concrete type in `app::triply_generic`. β”‚ - β”‚ ╭─[src/lib.rs:31:1] + β”‚ ╭─[blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:31:1] β”‚ 31 β”‚ bp.pre_process(f!(crate::doubly_generic)); β”‚ 32 β”‚ bp.pre_process(f!(crate::triply_generic)); β”‚ Β·  ────────────┬──────────── β”‚ Β· The pre-processing middleware was registered here β”‚ 33 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:15:1] + β”‚ ╭─[blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs:15:1] β”‚ 15 β”‚ β”‚ 16 β”‚ pub fn triply_generic( β”‚ Β·  ┬ ┬ ┬ diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/stderr.txt index 0441c7945..4bcc5b50f 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/stderr.txt @@ -3,7 +3,7 @@ β”‚ `app::A` has a named lifetime parameter, `'a`, that you haven't β”‚ constrained to be 'static. β”‚ - β”‚ ╭─[src/lib.rs:28:1] + β”‚ ╭─[blueprint/prebuilts/invalid_prebuilt/src/lib.rs:28:1] β”‚ 28 β”‚ let mut bp = Blueprint::new(); β”‚ 29 β”‚ bp.prebuilt(t!(crate::A)); β”‚ Β·  ──────┬───── @@ -16,10 +16,10 @@ ERROR: Γ— Prebuilt types can't have unassigned generic type parameters. - β”‚ `app::B` has a generic type parameter, `T`, that you haven't assigned a - β”‚ concrete type to. + β”‚ `app::B` has a generic type parameter, `T`, that you haven't + β”‚ assigned a concrete type to. β”‚ - β”‚ ╭─[src/lib.rs:29:1] + β”‚ ╭─[blueprint/prebuilts/invalid_prebuilt/src/lib.rs:29:1] β”‚ 29 β”‚ bp.prebuilt(t!(crate::A)); β”‚ 30 β”‚ bp.prebuilt(t!(crate::B)); β”‚ Β·  ──────┬───── @@ -32,10 +32,10 @@ ERROR: Γ— Prebuilt types can't have non-'static lifetime parameters. - β”‚ `app::C` has 3 named lifetime parameters that you haven't constrained to - β”‚ be 'static: `'a`, `'b` and `'c`. + β”‚ `app::C` has 3 named lifetime parameters that you haven't + β”‚ constrained to be 'static: `'a`, `'b` and `'c`. β”‚ - β”‚ ╭─[src/lib.rs:30:1] + β”‚ ╭─[blueprint/prebuilts/invalid_prebuilt/src/lib.rs:30:1] β”‚ 30 β”‚ bp.prebuilt(t!(crate::B)); β”‚ 31 β”‚ bp.prebuilt(t!(crate::C)); β”‚ Β·  ──────┬───── @@ -48,10 +48,10 @@ ERROR: Γ— Prebuilt types can't have unassigned generic type parameters. - β”‚ `app::D` has 3 generic type parameters that you haven't assigned concrete - β”‚ types to: `T`, `S` and `Z`. + β”‚ `app::D` has 3 generic type parameters that you haven't assigned + β”‚ concrete types to: `T`, `S` and `Z`. β”‚ - β”‚ ╭─[src/lib.rs:31:1] + β”‚ ╭─[blueprint/prebuilts/invalid_prebuilt/src/lib.rs:31:1] β”‚ 31 β”‚ bp.prebuilt(t!(crate::C)); β”‚ 32 β”‚ bp.prebuilt(t!(crate::D)); β”‚ Β·  ──────┬───── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/app.rs index 466977a33..861ef4918 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/app.rs @@ -87,11 +87,17 @@ pub mod route_0 { let response = wrapping_0(s_0, s_1).await; response } - async fn stage_1<'a>(s_0: app::A, s_1: &'a app::B) -> pavex::response::Response { + async fn stage_1<'a>( + s_0: app::A, + s_1: &'a app::B, + ) -> pavex::response::Response { let response = handler(s_0, s_1).await; response } - async fn wrapping_0(v0: app::A, v1: &app::B) -> pavex::response::Response { + async fn wrapping_0( + v0: app::A, + v1: &app::B, + ) -> pavex::response::Response { let v2 = crate::route_0::Next0 { s_0: v0, s_1: v1, @@ -101,7 +107,10 @@ pub mod route_0 { let v4 = pavex::middleware::wrap_noop(v3).await; ::into_response(v4) } - async fn handler(v0: app::A, v1: &app::B) -> pavex::response::Response { + async fn handler( + v0: app::A, + v1: &app::B, + ) -> pavex::response::Response { let v2 = app::handler(v0, v1); ::into_response(v2) } diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/ambiguous_fallback/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/router/ambiguous_fallback/expectations/stderr.txt index d32a19609..06bed8248 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/router/ambiguous_fallback/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/router/ambiguous_fallback/expectations/stderr.txt @@ -1,7 +1,7 @@ ERROR: Γ— Routing logic can't be ambiguous. - β”‚ You registered `app::fallback1` as the fallback handler for all unmatched - β”‚ incoming requests with a path that begins in `/users`. + β”‚ You registered `app::fallback1` as the fallback handler for all + β”‚ unmatched incoming requests with a path that begins in `/users`. β”‚ But `POST /users/yo` wasn't registered against that blueprint! β”‚ It was registered under a different blueprint, with a different fallback β”‚ handler: `pavex::router::default_fallback`. @@ -9,7 +9,7 @@ β”‚ `/users/yo` requests with a method that doesn't match the ones you β”‚ registered a handler for. β”‚ - β”‚ ╭─[src/lib.rs:26:1] + β”‚ ╭─[blueprint/router/ambiguous_fallback/src/lib.rs:26:1] β”‚ 26 β”‚ }); β”‚ 27 β”‚ bp.route(POST, "/users/yo", f!(crate::handler)); β”‚ Β·  ─────┬───── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/expectations/stderr.txt index a23ef0d66..64ca92616 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/expectations/stderr.txt @@ -2,14 +2,14 @@ Γ— I don't know how to route incoming `GET /home` requests: you have β”‚ registered 2 different request handlers for this path+method combination. β”‚ - β”‚ ╭─[src/lib.rs:16:1] + β”‚ ╭─[blueprint/router/conflicting_any_and_single_method_guards/src/lib.rs:16:1] β”‚ 16 β”‚ let mut bp = Blueprint::new(); β”‚ 17 β”‚ bp.route(ANY, "/home", f!(crate::handler_1)); β”‚ Β·  ──────────┬───────── β”‚ Β· ╰── The first conflicting handler β”‚ 18 β”‚ bp.route(GET, "/home", f!(crate::handler_2)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:17:1] + β”‚ ╭─[blueprint/router/conflicting_any_and_single_method_guards/src/lib.rs:17:1] β”‚ 17 β”‚ bp.route(ANY, "/home", f!(crate::handler_1)); β”‚ 18 β”‚ bp.route(GET, "/home", f!(crate::handler_2)); β”‚ Β·  ──────────┬───────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/different_fallback_for_each_method/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/router/different_fallback_for_each_method/expectations/stderr.txt index 4a61e758f..c4de3cb5a 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/router/different_fallback_for_each_method/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/router/different_fallback_for_each_method/expectations/stderr.txt @@ -1,22 +1,24 @@ ERROR: Γ— Routing logic can't be ambiguous. β”‚ You registered: - β”‚ - `app::fallback2` as the fallback handler for your `POST /id` route. - β”‚ - `app::fallback1` as the fallback handler for your `GET /id` route. + β”‚ - `app::fallback2` as the fallback handler for your `POST /id` + β”‚ route. + β”‚ - `app::fallback1` as the fallback handler for your `GET /id` + β”‚ route. β”‚ β”‚ I don't know which fallback handler to invoke for incoming `/id` requests β”‚ that use a different HTTP method (CONNECT, DELETE, HEAD, OPTIONS, PATCH, β”‚ PUT or TRACE)! β”‚ β”‚ - β”‚ ╭─[src/lib.rs:29:1] + β”‚ ╭─[blueprint/router/different_fallback_for_each_method/src/lib.rs:29:1] β”‚ 29 β”‚ bp.route(POST, "/id", f!(crate::handler)); β”‚ 30 β”‚ bp.fallback(f!(crate::fallback2)); β”‚ Β·  ──────────┬───────── β”‚ Β· ╰── The first fallback β”‚ 31 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:23:1] + β”‚ ╭─[blueprint/router/different_fallback_for_each_method/src/lib.rs:23:1] β”‚ 23 β”‚ bp.route(GET, "/id", f!(crate::handler)); β”‚ 24 β”‚ bp.fallback(f!(crate::fallback1)); β”‚ Β·  ──────────┬───────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/invalid_paths/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/router/invalid_paths/expectations/stderr.txt index 31c44e893..f71968846 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/router/invalid_paths/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/router/invalid_paths/expectations/stderr.txt @@ -1,7 +1,7 @@ ERROR: Γ— You can only register one path parameter per each path segment. β”‚ - β”‚ ╭─[src/lib.rs:12:1] + β”‚ ╭─[blueprint/router/invalid_paths/src/lib.rs:12:1] β”‚ 12 β”‚ let mut bp = Blueprint::new(); β”‚ 13 β”‚ bp.route(ANY, "/:too:many:params", f!(crate::handler)); β”‚ Β·  ─────────┬───────── @@ -12,7 +12,7 @@ ERROR: Γ— You can only use catch-all parameters at the end of a route path. β”‚ - β”‚ ╭─[src/lib.rs:13:1] + β”‚ ╭─[blueprint/router/invalid_paths/src/lib.rs:13:1] β”‚ 13 β”‚ bp.route(ANY, "/:too:many:params", f!(crate::handler)); β”‚ 14 β”‚ bp.route(GET, "/*invalid_catch_all/hey", f!(crate::handler)); β”‚ Β·  ────────────┬──────────── @@ -24,7 +24,7 @@ Γ— This route path, `/home/:home_id`, conflicts with the path of another β”‚ route you already registered, `/home/:id`. β”‚ - β”‚ ╭─[src/lib.rs:16:1] + β”‚ ╭─[blueprint/router/invalid_paths/src/lib.rs:16:1] β”‚ 16 β”‚ // Route conflict with the previous one β”‚ 17 β”‚ bp.route(GET, "/home/:home_id", f!(crate::handler)); β”‚ Β·  ────────┬─────── @@ -36,7 +36,7 @@ Γ— All path parameters must be named. You can't use anonymous parameters like β”‚ `:` or `*`. β”‚ - β”‚ ╭─[src/lib.rs:18:1] + β”‚ ╭─[blueprint/router/invalid_paths/src/lib.rs:18:1] β”‚ 18 β”‚ // Unnamed parameter β”‚ 19 β”‚ bp.route(GET, "/room/:", f!(crate::handler)); β”‚ Β·  ────┬──── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/route_path_is_validated/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/router/route_path_is_validated/expectations/stderr.txt index 17cafa626..0e6c55e74 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/router/route_path_is_validated/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/router/route_path_is_validated/expectations/stderr.txt @@ -2,7 +2,7 @@ Γ— Route paths must either be empty or begin with a forward slash, `/`. β”‚ `api` is not empty and it doesn't begin with a `/`. β”‚ - β”‚ ╭─[src/lib.rs:12:1] + β”‚ ╭─[blueprint/router/route_path_is_validated/src/lib.rs:12:1] β”‚ 12 β”‚ // If the path is not empty, it *must* start with a `/` β”‚ 13 β”‚ bp.route(GET, "api", f!(crate::handler)); β”‚ Β·  ──┬── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/expectations/stderr.txt index 08455d0d4..6df9c9145 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/expectations/stderr.txt @@ -1,8 +1,9 @@ ERROR: - Γ— I can work with functions and methods, but `app::Streamer` is neither. + Γ— I can work with functions and methods, but `app::Streamer` is + β”‚ neither. β”‚ It is a struct and I don't know how to use it as a request handler. β”‚ - β”‚ ╭─[src/lib.rs:7:1] + β”‚ ╭─[blueprint/router/structs_cannot_be_registered_as_handlers/src/lib.rs:7:1] β”‚ 7 β”‚ let mut bp = Blueprint::new(); β”‚ 8 β”‚ bp.route(GET, "/home", f!(crate::Streamer)); β”‚ Β·  ─────────┬───────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/expectations/stderr.txt index cc7b90097..dc4efe4f9 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/expectations/stderr.txt @@ -3,7 +3,7 @@ β”‚ `pavex::middleware::Next<_>` as input parameter. β”‚ This middleware does. β”‚ - β”‚ ╭─[src/lib.rs:20:1] + β”‚ ╭─[blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/lib.rs:20:1] β”‚ 20 β”‚ let mut bp = Blueprint::new(); β”‚ 21 β”‚ bp.wrap(f!(crate::mw)); β”‚ Β·  ──────┬────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/expectations/stderr.txt index a4587b757..0b6360c0f 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/expectations/stderr.txt @@ -3,7 +3,7 @@ β”‚ as input parameter. β”‚ This middleware doesn't. β”‚ - β”‚ ╭─[src/lib.rs:14:1] + β”‚ ╭─[blueprint/wrapping_middlewares/must_take_next_as_input/src/lib.rs:14:1] β”‚ 14 β”‚ let mut bp = Blueprint::new(); β”‚ 15 β”‚ bp.wrap(f!(crate::mw)); β”‚ Β·  ──────┬────── diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/expectations/stderr.txt index 9aea103e6..61bdd863d 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/expectations/stderr.txt @@ -1,15 +1,15 @@ ERROR: Γ— The generic parameter in `pavex::middleware::Next<_>` must a naked type β”‚ parameterβ€”i.e. `T` in `Next`. - β”‚ This wrapping middleware, instead, uses `app::Custom` as generic - β”‚ parameter for `Next`. + β”‚ This wrapping middleware, instead, uses `app::Custom` as + β”‚ generic parameter for `Next`. β”‚ - β”‚ ╭─[src/lib.rs:31:1] + β”‚ ╭─[blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/lib.rs:31:1] β”‚ 31 β”‚ let mut bp = Blueprint::new(); β”‚ 32 β”‚ bp.wrap(f!(crate::mw)); β”‚ Β·  ──────┬────── β”‚ Β· ╰── The wrapping middleware was registered here β”‚ 33 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ ╰──── - β”‚  help: Take `Next` rather than `Next>` as input parameter - β”‚ in your middleware. \ No newline at end of file + β”‚  help: Take `Next` rather than `Next>` as input + β”‚ parameter in your middleware. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt index f30aa438a..37ff12ccc 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt @@ -5,14 +5,14 @@ β”‚ apart from the one in `Next<_>`, but `T` does not seem to have been β”‚ assigned a concrete type. β”‚ - β”‚ ╭─[src/lib.rs:45:1] + β”‚ ╭─[blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs:45:1] β”‚ 45 β”‚ let mut bp = Blueprint::new(); β”‚ 46 β”‚ bp.wrap(f!(crate::generic_wrapping_middleware)); β”‚ Β·  ───────────────────┬────────────────── β”‚ Β· The wrapping middleware was registered here β”‚ 47 β”‚ bp.wrap(f!(crate::doubly_generic_wrapping_middleware)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:9:1] + β”‚ ╭─[blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs:9:1] β”‚  9 β”‚ β”‚ 10 β”‚ pub fn generic_wrapping_middleware(_next: Next, generic_input: GenericType) -> Response β”‚ Β·  ┬ @@ -32,14 +32,14 @@ β”‚ apart from the one in `Next<_>`, but `T` and `S` do not seem to have been β”‚ assigned a concrete type. β”‚ - β”‚ ╭─[src/lib.rs:46:1] + β”‚ ╭─[blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs:46:1] β”‚ 46 β”‚ bp.wrap(f!(crate::generic_wrapping_middleware)); β”‚ 47 β”‚ bp.wrap(f!(crate::doubly_generic_wrapping_middleware)); β”‚ Β·  ──────────────────────┬────────────────────── β”‚ Β· The wrapping middleware was registered here β”‚ 48 β”‚ bp.wrap(f!(crate::triply_generic_wrapping_middleware)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:16:1] + β”‚ ╭─[blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs:16:1] β”‚ 16 β”‚ β”‚ 17 β”‚ pub fn doubly_generic_wrapping_middleware( β”‚ Β·  ┬ ┬ @@ -61,14 +61,14 @@ β”‚ apart from the one in `Next<_>`, but `T`, `S` and `U` do not seem to have β”‚ been assigned a concrete type. β”‚ - β”‚ ╭─[src/lib.rs:47:1] + β”‚ ╭─[blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs:47:1] β”‚ 47 β”‚ bp.wrap(f!(crate::doubly_generic_wrapping_middleware)); β”‚ 48 β”‚ bp.wrap(f!(crate::triply_generic_wrapping_middleware)); β”‚ Β·  ──────────────────────┬────────────────────── β”‚ Β· The wrapping middleware was registered here β”‚ 49 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:27:1] + β”‚ ╭─[blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs:27:1] β”‚ 27 β”‚ β”‚ 28 β”‚ pub fn triply_generic_wrapping_middleware( β”‚ Β·  ┬ ┬ ┬ diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/expectations/stderr.txt index 42220d46b..817e1035c 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/expectations/stderr.txt @@ -1,17 +1,18 @@ ERROR: - Γ— You can't inject `&mut app::A` as an input parameter to `app::handler`, - β”‚ since `&mut app::A` has been marked `CloneIfNecessary`. + Γ— You can't inject `&mut app::A` as an input parameter to + β”‚ `app::handler`, since `&mut app::A` has been marked + β”‚ `CloneIfNecessary`. β”‚ Reasoning about mutations becomes impossible if Pavex can't guarantee that β”‚ all mutations will affect *the same* instance of `app::A`. β”‚ - β”‚ ╭─[src/lib.rs:18:1] + β”‚ ╭─[borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/lib.rs:18:1] β”‚ 18 β”‚ bp.request_scoped(f!(self::build)).clone_if_necessary(); β”‚ 19 β”‚ bp.route(GET, "/", f!(self::handler)); β”‚ Β·  ────────┬──────── β”‚ Β· ╰── The request handler was registered here β”‚ 20 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:11:1] + β”‚ ╭─[borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/lib.rs:11:1] β”‚ 11 β”‚ β”‚ 12 β”‚ pub fn handler(_a: &mut A) -> Response { β”‚ Β·  ─────┬──── diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/expectations/stderr.txt index d7bb1e118..afc44f768 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/expectations/stderr.txt @@ -1,15 +1,15 @@ ERROR: - Γ— You can't inject a mutable reference to a singleton (`&mut app::A`) as an - β”‚ input parameter to `app::handler`. + Γ— You can't inject a mutable reference to a singleton (`&mut + β”‚ app::A`) as an input parameter to `app::handler`. β”‚ - β”‚ ╭─[src/lib.rs:18:1] + β”‚ ╭─[borrow_checker/cannot_borrow_singletons_as_mut/src/lib.rs:18:1] β”‚ 18 β”‚ bp.singleton(f!(self::build)); β”‚ 19 β”‚ bp.route(GET, "/", f!(self::handler)); β”‚ Β·  ────────┬──────── β”‚ Β· ╰── The request handler was registered here β”‚ 20 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:11:1] + β”‚ ╭─[borrow_checker/cannot_borrow_singletons_as_mut/src/lib.rs:11:1] β”‚ 11 β”‚ β”‚ 12 β”‚ pub fn handler(_a: &mut A) -> Response { β”‚ Β·  ─────┬──── diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/expectations/stderr.txt index 22c0e6dcd..d83575110 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/expectations/stderr.txt @@ -1,18 +1,18 @@ ERROR: - Γ— You can't inject a mutable reference to a transient type (`&mut app::A`) - β”‚ as an input parameter to `app::handler`. + Γ— You can't inject a mutable reference to a transient type (`&mut + β”‚ app::A`) as an input parameter to `app::handler`. β”‚ Transient constructors are invoked every time their output is neededβ€” β”‚ instances of transient types are never reused. The result of any mutation β”‚ would be immediately discarded. β”‚ - β”‚ ╭─[src/lib.rs:18:1] + β”‚ ╭─[borrow_checker/cannot_borrow_transients_as_mut/src/lib.rs:18:1] β”‚ 18 β”‚ bp.transient(f!(self::build)); β”‚ 19 β”‚ bp.route(GET, "/", f!(self::handler)); β”‚ Β·  ────────┬──────── β”‚ Β· ╰── The request handler was registered here β”‚ 20 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:11:1] + β”‚ ╭─[borrow_checker/cannot_borrow_transients_as_mut/src/lib.rs:11:1] β”‚ 11 β”‚ β”‚ 12 β”‚ pub fn handler(_a: &mut A) -> Response { β”‚ Β·  ─────┬──── diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/expectations/stderr.txt index e9f629ffb..767d965d6 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/expectations/stderr.txt @@ -1,18 +1,20 @@ ERROR: Γ— I can't generate code that will pass the borrow checker *and* match the β”‚ instructions in your blueprint. - β”‚ There are 2 components that take `app::B` as an input parameter, consuming - β”‚ it by value: + β”‚ There are 2 components that take `app::B` as an input parameter, + β”‚ consuming it by value: β”‚ - `app::handler`, a request handler β”‚ - `app::c`, a constructor - β”‚ Since I'm not allowed to clone `app::B`, I can't resolve this conflict. + β”‚ Since I'm not allowed to clone `app::B`, I can't resolve this + β”‚ conflict. β”‚ β”‚ - β”‚ help: Allow me to clone `app::B` in order to satisfy the borrow checker. + β”‚ help: Allow me to clone `app::B` in order to satisfy the borrow + β”‚ checker. β”‚ You can do so by invoking `.cloning(CloningStrategy::CloneIfNecessary)` β”‚ on the type returned by `.constructor`. β”‚ ☞ - β”‚ ╭─[src/lib.rs:65:1] + β”‚ ╭─[borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs:65:1] β”‚ 65 β”‚ .error_handler(f!(crate::error_handler)); β”‚ 66 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── @@ -23,7 +25,7 @@ β”‚ `app::B` by value. β”‚ Would a shared reference, `&app::B`, be enough? β”‚ ☞ - β”‚ ╭─[src/lib.rs:67:1] + β”‚ ╭─[borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs:67:1] β”‚ 67 β”‚ bp.constructor(f!(crate::c), Lifecycle::RequestScoped); β”‚ 68 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ Β·  ─────────┬──────── @@ -31,12 +33,12 @@ β”‚ 69 β”‚ bp β”‚ ╰──── β”‚ ☞ - β”‚ ╭─[src/lib.rs:66:1] + β”‚ ╭─[borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs:66:1] β”‚ 66 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ 67 β”‚ bp.constructor(f!(crate::c), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── β”‚ Β· ╰── One of the consuming constructors β”‚ 68 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ ╰──── - β”‚ help: If `app::B` itself cannot implement `Clone`, consider wrapping it in - β”‚ an `std::sync::Rc` or `std::sync::Arc`. \ No newline at end of file + β”‚ help: If `app::B` itself cannot implement `Clone`, consider + β”‚ wrapping it in an `std::sync::Rc` or `std::sync::Arc`. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/expectations/stderr.txt index b62dc3788..d25f79bae 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/expectations/stderr.txt @@ -5,11 +5,12 @@ β”‚ below! β”‚ You only need to follow *one* of them. β”‚ - β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow checker. + β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow + β”‚ checker. β”‚ You can do so by invoking `.cloning(CloningStrategy::CloneIfNecessary)` β”‚ on the type returned by `.constructor`. β”‚ ☞ - β”‚ ╭─[src/lib.rs:51:1] + β”‚ ╭─[borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs:51:1] β”‚ 51 β”‚ let mut bp = Blueprint::new(); β”‚ 52 β”‚ bp.constructor(f!(crate::a), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── @@ -17,10 +18,10 @@ β”‚ 53 β”‚ // Being a singleton, this will be an input type of the dependency closure for the request handler β”‚ ╰──── β”‚ help: Considering changing the signature of `app::a`. - β”‚ It takes `app::A` by value. Would a shared reference, `&app::A`, be - β”‚ enough? - β”‚ help: If `app::A` itself cannot implement `Clone`, consider wrapping it in - β”‚ an `std::sync::Rc` or `std::sync::Arc`. + β”‚ It takes `app::A` by value. Would a shared reference, + β”‚ `&app::A`, be enough? + β”‚ help: If `app::A` itself cannot implement `Clone`, consider + β”‚ wrapping it in an `std::sync::Rc` or `std::sync::Arc`. ERROR: Γ— I can't generate code that will pass the borrow checker *and* match the @@ -29,11 +30,12 @@ β”‚ below! β”‚ You only need to follow *one* of them. β”‚ - β”‚ help: Allow me to clone `app::B` in order to satisfy the borrow checker. + β”‚ help: Allow me to clone `app::B` in order to satisfy the borrow + β”‚ checker. β”‚ You can do so by invoking `.cloning(CloningStrategy::CloneIfNecessary)` β”‚ on the type returned by `.constructor`. β”‚ ☞ - β”‚ ╭─[src/lib.rs:53:1] + β”‚ ╭─[borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs:53:1] β”‚ 53 β”‚ // Being a singleton, this will be an input type of the dependency closure for the request handler β”‚ 54 β”‚ bp.constructor(f!(crate::b), Lifecycle::Singleton); β”‚ Β·  ──────┬───── @@ -41,5 +43,5 @@ β”‚ 55 β”‚ bp.constructor(f!(crate::c), Lifecycle::RequestScoped); β”‚ ╰──── β”‚ help: Considering changing the signature of `app::b`. - β”‚ It takes `app::B` by value. Would a shared reference, `&app::B`, be - β”‚ enough? \ No newline at end of file + β”‚ It takes `app::B` by value. Would a shared reference, + β”‚ `&app::B`, be enough? \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/expectations/stderr.txt index 17bd45e7f..a851f4aa7 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/expectations/stderr.txt @@ -13,7 +13,7 @@ β”‚ `pavex::request::RequestHead` by value. β”‚ Would a shared reference, `&pavex::request::RequestHead`, be enough? β”‚ ☞ - β”‚ ╭─[src/lib.rs:39:1] + β”‚ ╭─[borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs:39:1] β”‚ 39 β”‚ let mut bp = Blueprint::new(); β”‚ 40 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── @@ -21,7 +21,7 @@ β”‚ 41 β”‚ bp.constructor(f!(crate::c), Lifecycle::RequestScoped); β”‚ ╰──── β”‚ ☞ - β”‚ ╭─[src/lib.rs:40:1] + β”‚ ╭─[borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs:40:1] β”‚ 40 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ 41 β”‚ bp.constructor(f!(crate::c), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/expectations/stderr.txt index f3ef28313..d4030acc5 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/expectations/stderr.txt @@ -1,18 +1,20 @@ ERROR: Γ— I can't generate code that will pass the borrow checker *and* match the β”‚ instructions in your blueprint. - β”‚ There are 2 components that take `app::A` as an input parameter, consuming - β”‚ it by value: + β”‚ There are 2 components that take `app::A` as an input parameter, + β”‚ consuming it by value: β”‚ - `app::b`, a constructor β”‚ - `app::c`, a constructor - β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this conflict. + β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this + β”‚ conflict. β”‚ β”‚ - β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow checker. + β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow + β”‚ checker. β”‚ You can do so by invoking `.cloning(CloningStrategy::CloneIfNecessary)` β”‚ on the type returned by `.constructor`. β”‚ ☞ - β”‚ ╭─[src/lib.rs:43:1] + β”‚ ╭─[borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs:43:1] β”‚ 43 β”‚ // `A` is a singleton, therefore it will be an input of the dependency closure for the handler β”‚ 44 β”‚ bp.constructor(f!(crate::a), Lifecycle::Singleton); β”‚ Β·  ──────┬───── @@ -23,7 +25,7 @@ β”‚ `app::A` by value. β”‚ Would a shared reference, `&app::A`, be enough? β”‚ ☞ - β”‚ ╭─[src/lib.rs:44:1] + β”‚ ╭─[borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs:44:1] β”‚ 44 β”‚ bp.constructor(f!(crate::a), Lifecycle::Singleton); β”‚ 45 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── @@ -31,7 +33,7 @@ β”‚ 46 β”‚ bp.constructor(f!(crate::c), Lifecycle::RequestScoped); β”‚ ╰──── β”‚ ☞ - β”‚ ╭─[src/lib.rs:45:1] + β”‚ ╭─[borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs:45:1] β”‚ 45 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ 46 β”‚ bp.constructor(f!(crate::c), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/expectations/stderr.txt index 28225ce14..a9eae62a4 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/expectations/stderr.txt @@ -1,18 +1,20 @@ ERROR: Γ— I can't generate code that will pass the borrow checker *and* match the β”‚ instructions in your blueprint. - β”‚ There are 2 components that take `app::A` as an input parameter, consuming - β”‚ it by value: + β”‚ There are 2 components that take `app::A` as an input parameter, + β”‚ consuming it by value: β”‚ - `app::b`, a constructor β”‚ - `app::c`, a constructor - β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this conflict. + β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this + β”‚ conflict. β”‚ β”‚ - β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow checker. + β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow + β”‚ checker. β”‚ You can do so by invoking `.cloning(CloningStrategy::CloneIfNecessary)` β”‚ on the type returned by `.constructor`. β”‚ ☞ - β”‚ ╭─[src/lib.rs:41:1] + β”‚ ╭─[borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs:41:1] β”‚ 41 β”‚ let mut bp = Blueprint::new(); β”‚ 42 β”‚ bp.constructor(f!(crate::a), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── @@ -23,7 +25,7 @@ β”‚ `app::A` by value. β”‚ Would a shared reference, `&app::A`, be enough? β”‚ ☞ - β”‚ ╭─[src/lib.rs:42:1] + β”‚ ╭─[borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs:42:1] β”‚ 42 β”‚ bp.constructor(f!(crate::a), Lifecycle::RequestScoped); β”‚ 43 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── @@ -31,12 +33,12 @@ β”‚ 44 β”‚ bp.constructor(f!(crate::c), Lifecycle::RequestScoped); β”‚ ╰──── β”‚ ☞ - β”‚ ╭─[src/lib.rs:43:1] + β”‚ ╭─[borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs:43:1] β”‚ 43 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ 44 β”‚ bp.constructor(f!(crate::c), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── β”‚ Β· ╰── One of the consuming constructors β”‚ 45 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ ╰──── - β”‚ help: If `app::A` itself cannot implement `Clone`, consider wrapping it in - β”‚ an `std::sync::Rc` or `std::sync::Arc`. \ No newline at end of file + β”‚ help: If `app::A` itself cannot implement `Clone`, consider + β”‚ wrapping it in an `std::sync::Rc` or `std::sync::Arc`. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/expectations/stderr.txt index ed8f04796..9a34f8c86 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/expectations/stderr.txt @@ -1,18 +1,20 @@ ERROR: Γ— I can't generate code that will pass the borrow checker *and* match the β”‚ instructions in your blueprint. - β”‚ There are 2 components that take `app::A` as an input parameter, consuming - β”‚ it by value: + β”‚ There are 2 components that take `app::A` as an input parameter, + β”‚ consuming it by value: β”‚ - `app::mw`, a wrapping middleware β”‚ - `crate::route_0::Next1` - β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this conflict. + β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this + β”‚ conflict. β”‚ β”‚ - β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow checker. + β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow + β”‚ checker. β”‚ You can do so by invoking `.cloning(CloningStrategy::CloneIfNecessary)` β”‚ on the type returned by `.constructor`. β”‚ ☞ - β”‚ ╭─[src/lib.rs:29:1] + β”‚ ╭─[borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs:29:1] β”‚ 29 β”‚ let mut bp = Blueprint::new(); β”‚ 30 β”‚ bp.constructor(f!(crate::a), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── @@ -23,12 +25,12 @@ β”‚ `app::A` by value. β”‚ Would a shared reference, `&app::A`, be enough? β”‚ ☞ - β”‚ ╭─[src/lib.rs:30:1] + β”‚ ╭─[borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs:30:1] β”‚ 30 β”‚ bp.constructor(f!(crate::a), Lifecycle::RequestScoped); β”‚ 31 β”‚ bp.wrap(f!(crate::mw)); β”‚ Β·  ──────┬────── β”‚ Β· ╰── One of the consuming wrapping middlewares β”‚ 32 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ ╰──── - β”‚ help: If `app::A` itself cannot implement `Clone`, consider wrapping it in - β”‚ an `std::sync::Rc` or `std::sync::Arc`. \ No newline at end of file + β”‚ help: If `app::A` itself cannot implement `Clone`, consider + β”‚ wrapping it in an `std::sync::Rc` or `std::sync::Arc`. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/expectations/stderr.txt index 31083c6de..1f0f92b3f 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/expectations/stderr.txt @@ -3,11 +3,12 @@ β”‚ instructions in your blueprint: β”‚ - `app::handler` wants to consume `app::B<'_>` β”‚ - `app::B<'_>` captures a reference to `app::A` - β”‚ - But, at the same time, `app::handler` takes `&mut app::A` as input + β”‚ - But, at the same time, `app::handler` takes `&mut + β”‚ app::A` as input β”‚ β”‚ You can't borrow a type mutably while an immutable reference to the same β”‚ type is still active. I can't resolve this conflict. β”‚ β”‚ help: Consider changing the signature of `app::handler`. - β”‚ It takes a mutable reference to `app::A`. Would a shared reference, - β”‚ `&app::A`, be enough? \ No newline at end of file + β”‚ It takes a mutable reference to `app::A`. Would a shared + β”‚ reference, `&app::A`, be enough? \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/expectations/stderr.txt index 406529f17..f2cb42d78 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/expectations/stderr.txt @@ -5,13 +5,15 @@ β”‚ - `app::C<'_>` captures a reference to `app::A` β”‚ - But, earlier on, `app::b` consumed `app::A` by value β”‚ - β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this conflict. + β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this + β”‚ conflict. β”‚ - β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow checker. + β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow + β”‚ checker. β”‚ You can do so by invoking `.cloning(CloningStrategy::CloneIfNecessary)` β”‚ on the type returned by `.constructor`. β”‚ ☞ - β”‚ ╭─[src/lib.rs:47:1] + β”‚ ╭─[borrow_checker/transitive_borrows/src/lib.rs:47:1] β”‚ 47 β”‚ let mut bp = Blueprint::new(); β”‚ 48 β”‚ bp.constructor(f!(crate::a), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── @@ -19,7 +21,7 @@ β”‚ 49 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ ╰──── β”‚ help: Consider changing the signature of `app::b`. - β”‚ It takes `app::A` by value. Would a shared reference, `&app::A`, be - β”‚ enough? - β”‚ help: If `app::A` itself cannot implement `Clone`, consider wrapping it in - β”‚ an `std::sync::Rc` or `std::sync::Arc`. \ No newline at end of file + β”‚ It takes `app::A` by value. Would a shared reference, + β”‚ `&app::A`, be enough? + β”‚ help: If `app::A` itself cannot implement `Clone`, consider + β”‚ wrapping it in an `std::sync::Rc` or `std::sync::Arc`. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/expectations/stderr.txt index 83bef6b5f..f76556111 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/expectations/stderr.txt @@ -2,8 +2,8 @@ Γ— I can't generate code that will pass the borrow checker *and* match the β”‚ instructions in your blueprint: β”‚ - `app::handler` wants to borrow `pavex::request::RequestHead` - β”‚ - But, earlier on, `app::b` consumed `pavex::request::RequestHead` by - β”‚ value + β”‚ - But, earlier on, `app::b` consumed + β”‚ `pavex::request::RequestHead` by value β”‚ β”‚ Since I'm not allowed to clone `pavex::request::RequestHead`, I can't β”‚ resolve this conflict. diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/expectations/stderr.txt index f367c28fc..971443ce6 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/expectations/stderr.txt @@ -4,13 +4,15 @@ β”‚ - `app::handler` wants to borrow `app::A` β”‚ - But, earlier on, `app::b` consumed `app::A` by value β”‚ - β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this conflict. + β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this + β”‚ conflict. β”‚ - β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow checker. + β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow + β”‚ checker. β”‚ You can do so by invoking `.cloning(CloningStrategy::CloneIfNecessary)` β”‚ on the type returned by `.constructor`. β”‚ ☞ - β”‚ ╭─[src/lib.rs:37:1] + β”‚ ╭─[borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/lib.rs:37:1] β”‚ 37 β”‚ // A is a singleton, so it will be an input parameter of the dependency closure for `handler` β”‚ 38 β”‚ bp.constructor(f!(crate::a), Lifecycle::Singleton); β”‚ Β·  ──────┬───── @@ -18,5 +20,5 @@ β”‚ 39 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ ╰──── β”‚ help: Consider changing the signature of `app::b`. - β”‚ It takes `app::A` by value. Would a shared reference, `&app::A`, be - β”‚ enough? \ No newline at end of file + β”‚ It takes `app::A` by value. Would a shared reference, + β”‚ `&app::A`, be enough? \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/expectations/stderr.txt index 7e0382b1e..92e52a9b4 100644 --- a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/expectations/stderr.txt @@ -4,13 +4,15 @@ β”‚ - `app::handler` wants to borrow `app::A` β”‚ - But, earlier on, `app::b` consumed `app::A` by value β”‚ - β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this conflict. + β”‚ Since I'm not allowed to clone `app::A`, I can't resolve this + β”‚ conflict. β”‚ - β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow checker. + β”‚ help: Allow me to clone `app::A` in order to satisfy the borrow + β”‚ checker. β”‚ You can do so by invoking `.cloning(CloningStrategy::CloneIfNecessary)` β”‚ on the type returned by `.constructor`. β”‚ ☞ - β”‚ ╭─[src/lib.rs:36:1] + β”‚ ╭─[borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/lib.rs:36:1] β”‚ 36 β”‚ let mut bp = Blueprint::new(); β”‚ 37 β”‚ bp.constructor(f!(crate::a), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── @@ -18,7 +20,7 @@ β”‚ 38 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ ╰──── β”‚ help: Consider changing the signature of `app::b`. - β”‚ It takes `app::A` by value. Would a shared reference, `&app::A`, be - β”‚ enough? - β”‚ help: If `app::A` itself cannot implement `Clone`, consider wrapping it in - β”‚ an `std::sync::Rc` or `std::sync::Arc`. \ No newline at end of file + β”‚ It takes `app::A` by value. Would a shared reference, + β”‚ `&app::A`, be enough? + β”‚ help: If `app::A` itself cannot implement `Clone`, consider + β”‚ wrapping it in an `std::sync::Rc` or `std::sync::Arc`. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot b/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot index 2d952b198..19b619de1 100644 --- a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot +++ b/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot @@ -9,7 +9,7 @@ digraph "GET /route - 0" { } digraph "GET /route - 1" { - 0 [ label = "app_56967fe8::root() -> pavex::response::Response"] + 0 [ label = "app::root() -> pavex::response::Response"] 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] 0 -> 1 [ ] } @@ -27,7 +27,7 @@ digraph "* /route - 0" { } digraph "* /route - 1" { - 0 [ label = "app_56967fe8::get_connection_info(&pavex::connection::ConnectionInfo) -> pavex::response::Response"] + 0 [ label = "app::get_connection_info(&pavex::connection::ConnectionInfo) -> pavex::response::Response"] 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] 3 [ label = "&pavex::connection::ConnectionInfo"] 0 -> 2 [ ] diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/expectations/stderr.txt index 5d7bf4101..3ac6ac2e1 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/expectations/stderr.txt @@ -4,8 +4,10 @@ β”‚ β”‚ The cycle looks like this: β”‚ - β”‚ - `app::b` depends on `app::A`, which is built by `app::a` - β”‚ - `app::a` depends on `app::B`, which is built by `app::b` + β”‚ - `app::b` depends on `app::A`, which is built by + β”‚ `app::a` + β”‚ - `app::a` depends on `app::B`, which is built by + β”‚ `app::b` β”‚ β”‚  help: Break the cycle! Remove one of the 'depends-on' relationship by β”‚ changing the signature of one of the components in the cycle. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/request_scoped_cycles/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/request_scoped_cycles/expectations/stderr.txt index aa8bbc345..20ba64cc9 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/request_scoped_cycles/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/request_scoped_cycles/expectations/stderr.txt @@ -4,9 +4,12 @@ β”‚ β”‚ The cycle looks like this: β”‚ - β”‚ - `app::b` depends on `app::C`, which is built by `app::c` - β”‚ - `app::c` depends on `app::A`, which is built by `app::a` - β”‚ - `app::a` depends on `app::B`, which is built by `app::b` + β”‚ - `app::b` depends on `app::C`, which is built by + β”‚ `app::c` + β”‚ - `app::c` depends on `app::A`, which is built by + β”‚ `app::a` + β”‚ - `app::a` depends on `app::B`, which is built by + β”‚ `app::b` β”‚ β”‚  help: Break the cycle! Remove one of the 'depends-on' relationship by β”‚ changing the signature of one of the components in the cycle. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/transient_cycles/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/transient_cycles/expectations/stderr.txt index aa8bbc345..20ba64cc9 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/transient_cycles/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/transient_cycles/expectations/stderr.txt @@ -4,9 +4,12 @@ β”‚ β”‚ The cycle looks like this: β”‚ - β”‚ - `app::b` depends on `app::C`, which is built by `app::c` - β”‚ - `app::c` depends on `app::A`, which is built by `app::a` - β”‚ - `app::a` depends on `app::B`, which is built by `app::b` + β”‚ - `app::b` depends on `app::C`, which is built by + β”‚ `app::c` + β”‚ - `app::c` depends on `app::A`, which is built by + β”‚ `app::a` + β”‚ - `app::a` depends on `app::B`, which is built by + β”‚ `app::b` β”‚ β”‚  help: Break the cycle! Remove one of the 'depends-on' relationship by β”‚ changing the signature of one of the components in the cycle. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/expectations/stderr.txt index 6c341b6f2..bdd51d68e 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/expectations/stderr.txt @@ -1,9 +1,10 @@ ERROR: - Γ— `&app::B` can't be a singleton because its lifetime isn't `'static`. + Γ— `&app::B` can't be a singleton because its lifetime isn't + β”‚ `'static`. β”‚ Singletons must be available for as long as the application is running, β”‚ therefore their lifetime must be `'static`. β”‚ - β”‚ ╭─[src/lib.rs:25:1] + β”‚ ╭─[dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/lib.rs:25:1] β”‚ 25 β”‚ bp.constructor(f!(crate::a), Lifecycle::Singleton); β”‚ 26 β”‚ bp.constructor(f!(crate::b), Lifecycle::Singleton); β”‚ Β·  ──────┬───── diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/expectations/stderr.txt index d18a9585e..a25fa6002 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/expectations/stderr.txt @@ -2,17 +2,17 @@ Γ— Singletons can't depend on request-scoped components. β”‚ They are constructed before the application starts, outside of the β”‚ request-response lifecycle. - β”‚ But your singleton `app::A` depends on `app::B`, which has a request- - β”‚ scoped lifecycle. + β”‚ But your singleton `app::A` depends on `app::B`, which + β”‚ has a request-scoped lifecycle. β”‚ - β”‚ ╭─[src/lib.rs:29:1] + β”‚ ╭─[dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs:29:1] β”‚ 29 β”‚ let mut bp = Blueprint::new(); β”‚ 30 β”‚ bp.constructor(f!(crate::a), Lifecycle::Singleton); β”‚ Β·  ──────┬───── β”‚ Β· ╰── The singleton was registered here β”‚ 31 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:30:1] + β”‚ ╭─[dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs:30:1] β”‚ 30 β”‚ bp.constructor(f!(crate::a), Lifecycle::Singleton); β”‚ 31 β”‚ bp.constructor(f!(crate::b), Lifecycle::RequestScoped); β”‚ Β·  ──────┬───── diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/expectations/stderr.txt index 41370fbfb..110a4b4a4 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/expectations/stderr.txt @@ -1,10 +1,10 @@ ERROR: - Γ— `app::B<'a>` can't be a singleton because at least one of its lifetime - β”‚ parameters isn't `'static`. + Γ— `app::B<'a>` can't be a singleton because at least one of its + β”‚ lifetime parameters isn't `'static`. β”‚ Singletons must be available for as long as the application is running, β”‚ therefore their lifetime must be `'static`. β”‚ - β”‚ ╭─[src/lib.rs:26:1] + β”‚ ╭─[dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/lib.rs:26:1] β”‚ 26 β”‚ bp.singleton(f!(self::a)); β”‚ 27 β”‚ bp.singleton(f!(self::B::new)).clone_if_necessary(); β”‚ Β·  ────────┬─────── diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_handler_dependency/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_handler_dependency/expectations/stderr.txt index 00b6d37cc..7dcc3e847 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_handler_dependency/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_handler_dependency/expectations/stderr.txt @@ -3,14 +3,14 @@ β”‚ I need an instance of `std::path::PathBuf` to invoke your request handler, β”‚ `app::stream_file`. β”‚ - β”‚ ╭─[src/lib.rs:11:1] + β”‚ ╭─[dependency_injection/missing_handler_dependency/src/lib.rs:11:1] β”‚ 11 β”‚ let mut bp = Blueprint::new(); β”‚ 12 β”‚ bp.route(GET, "/home", f!(crate::stream_file)); β”‚ Β·  ───────────┬────────── β”‚ Β· The request handler was registered here β”‚ 13 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:5:1] + β”‚ ╭─[dependency_injection/missing_handler_dependency/src/lib.rs:5:1] β”‚ 5 β”‚ β”‚ 6 β”‚ pub fn stream_file(_inner: PathBuf) -> pavex::response::Response { β”‚ Β·  ───────┬─────── @@ -20,4 +20,4 @@ β”‚ help: Register a constructor for `std::path::PathBuf`. β”‚  help: Alternatively, use `Blueprint::prebuilt` to add a new input β”‚ parameter of type `std::path::PathBuf` to the (generated) - β”‚ `build_application_state`. + β”‚ `build_application_state`. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_singleton_dependency/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_singleton_dependency/expectations/stderr.txt index 9999c119a..44128433f 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_singleton_dependency/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_singleton_dependency/expectations/stderr.txt @@ -1,15 +1,16 @@ ERROR: Γ— I can't find a constructor for `&app::A`. - β”‚ I need an instance of `&app::A` to invoke your constructor, `app::b`. + β”‚ I need an instance of `&app::A` to invoke your constructor, + β”‚ `app::b`. β”‚ - β”‚ ╭─[src/lib.rs:20:1] + β”‚ ╭─[dependency_injection/missing_singleton_dependency/src/lib.rs:20:1] β”‚ 20 β”‚ let mut bp = Blueprint::new(); β”‚ 21 β”‚ bp.singleton(f!(crate::b)); β”‚ Β·  ──────┬───── β”‚ Β· ╰── The constructor was registered here β”‚ 22 β”‚ bp.route(GET, "/", f!(crate::handler)); β”‚ ╰──── - β”‚ ╭─[src/lib.rs:10:1] + β”‚ ╭─[dependency_injection/missing_singleton_dependency/src/lib.rs:10:1] β”‚ 10 β”‚ β”‚ 11 β”‚ pub fn b(a: &A) -> B { β”‚ Β·  ──┬── @@ -17,6 +18,6 @@ β”‚ 12 β”‚ todo!() β”‚ ╰──── β”‚ help: Register a constructor for `&app::A`. - β”‚  help: Alternatively, use `Blueprint::prebuilt` to add a new - β”‚ input parameter of type `&app::A` to the (generated) + β”‚  help: Alternatively, use `Blueprint::prebuilt` to add a new input + β”‚ parameter of type `&app::A` to the (generated) β”‚ `build_application_state`. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/app.rs index 608c05fca..dc3d1eba5 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/app.rs @@ -79,7 +79,9 @@ async fn route_request( } } pub mod route_0 { - pub async fn entrypoint<'a>(s_0: &'a app::Singleton) -> pavex::response::Response { + pub async fn entrypoint<'a>( + s_0: &'a app::Singleton, + ) -> pavex::response::Response { let response = wrapping_0(s_0).await; response } @@ -87,7 +89,9 @@ pub mod route_0 { let response = wrapping_1(s_0).await; response } - async fn stage_2<'a>(s_0: &'a app::RequestScoped) -> pavex::response::Response { + async fn stage_2<'a>( + s_0: &'a app::RequestScoped, + ) -> pavex::response::Response { let response = handler(s_0).await; let response = post_processing_0(response, s_0).await; response diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/stderr.txt index b7b5426b5..a019fe986 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/stderr.txt @@ -1,16 +1,16 @@ ERROR: Γ— I can't find a constructor for `app::Tied`. - β”‚ I need an instance of `app::Tied` to invoke your request - β”‚ handler, `app::handler`. + β”‚ I need an instance of `app::Tied` to invoke your + β”‚ request handler, `app::handler`. β”‚ - β”‚ ╭─[src/lib.rs:19:1] + β”‚ ╭─[dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/lib.rs:19:1] β”‚ 19 β”‚ bp.constructor(f!(crate::tied), Lifecycle::RequestScoped); β”‚ 20 β”‚ bp.route(GET, "/home", f!(crate::handler)); β”‚ Β·  ─────────┬──────── β”‚ Β· The request handler was registered here β”‚ 21 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:11:1] + β”‚ ╭─[dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/lib.rs:11:1] β”‚ 11 β”‚ // This can't be built because `tied` can only give you Tied or Tied! β”‚ 12 β”‚ tied: Tied, β”‚ Β·  ──────────┬───────── @@ -20,4 +20,4 @@ β”‚ help: Register a constructor for `app::Tied`. β”‚  help: Alternatively, use `Blueprint::prebuilt` to add a new input β”‚ parameter of type `app::Tied` to the (generated) - β”‚ `build_application_state`. + β”‚ `build_application_state`. \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/app.rs index c7c1a849a..48911b92e 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/app.rs @@ -71,7 +71,9 @@ async fn route_request( } } pub mod route_0 { - pub async fn entrypoint<'a>(s_0: &'a app::Singleton) -> pavex::response::Response { + pub async fn entrypoint<'a>( + s_0: &'a app::Singleton, + ) -> pavex::response::Response { let response = wrapping_0(s_0).await; response } diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/some_types_cannot_be_constructed/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/dependency_injection/some_types_cannot_be_constructed/expectations/stderr.txt index dd6deb6e1..185dbcc3d 100644 --- a/libs/pavex_cli/tests/ui_tests/dependency_injection/some_types_cannot_be_constructed/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/dependency_injection/some_types_cannot_be_constructed/expectations/stderr.txt @@ -3,7 +3,7 @@ β”‚ `pavex::Error` can only be used as the error type of your fallible β”‚ components. β”‚ - β”‚ ╭─[src/lib.rs:87:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:87:1] β”‚ 87 β”‚ let mut bp = Blueprint::new(); β”‚ 88 β”‚ bp.constructor(f!(crate::error_ref), Lifecycle::RequestScoped); β”‚ Β·  ──────────┬───────── @@ -16,7 +16,7 @@ β”‚ You can only return a response from request handlers, middlewares or error β”‚ handlers. β”‚ - β”‚ ╭─[src/lib.rs:88:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:88:1] β”‚ 88 β”‚ bp.constructor(f!(crate::error_ref), Lifecycle::RequestScoped); β”‚ 89 β”‚ bp.constructor(f!(crate::response_ref), Lifecycle::RequestScoped); β”‚ Β·  ───────────┬─────────── @@ -29,7 +29,7 @@ β”‚ `pavex::request::RequestHead` is a framework primitive, you can't override β”‚ the way it's built by Pavex. β”‚ - β”‚ ╭─[src/lib.rs:89:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:89:1] β”‚ 89 β”‚ bp.constructor(f!(crate::response_ref), Lifecycle::RequestScoped); β”‚ 90 β”‚ bp.constructor(f!(crate::request_head_ref), Lifecycle::RequestScoped); β”‚ Β·  ─────────────┬───────────── @@ -42,7 +42,7 @@ β”‚ `pavex::router::AllowedMethods` is a framework primitive, you can't β”‚ override the way it's built by Pavex. β”‚ - β”‚ ╭─[src/lib.rs:90:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:90:1] β”‚ 90 β”‚ bp.constructor(f!(crate::request_head_ref), Lifecycle::RequestScoped); β”‚ 91 β”‚ bp.constructor(f!(crate::allowed_methods_ref), Lifecycle::RequestScoped); β”‚ Β·  ───────────────┬────────────── @@ -56,7 +56,7 @@ β”‚ `pavex::request::body::RawIncomingBody` is a framework primitive, you β”‚ can't override the way it's built by Pavex. β”‚ - β”‚ ╭─[src/lib.rs:91:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:91:1] β”‚ 91 β”‚ bp.constructor(f!(crate::allowed_methods_ref), Lifecycle::RequestScoped); β”‚ 92 β”‚ bp.constructor(f!(crate::raw_incoming_body_ref), Lifecycle::RequestScoped); β”‚ Β·  ────────────────┬─────────────── @@ -70,7 +70,7 @@ β”‚ `pavex::request::path::MatchedPathPattern` is a framework primitive, you β”‚ can't override the way it's built by Pavex. β”‚ - β”‚ ╭─[src/lib.rs:93:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:93:1] β”‚ 93 β”‚ bp.constructor( β”‚ 94 β”‚ f!(crate::matched_path_pattern_ref), β”‚ Β·  ─────────────────┬───────────────── @@ -84,7 +84,7 @@ β”‚ `pavex::request::path::RawPathParams<'server, 'request>` is a framework β”‚ primitive, you can't override the way it's built by Pavex. β”‚ - β”‚ ╭─[src/lib.rs:96:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:96:1] β”‚ 96 β”‚ ); β”‚ 97 β”‚ bp.constructor(f!(crate::raw_path_params_ref), Lifecycle::RequestScoped); β”‚ Β·  ───────────────┬────────────── @@ -97,7 +97,7 @@ β”‚ `pavex::Error` can only be used as the error type of your fallible β”‚ components. β”‚ - β”‚ ╭─[src/lib.rs:75:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:75:1] β”‚ 75 β”‚ let mut bp = Blueprint::new(); β”‚ 76 β”‚ bp.constructor(f!(crate::error), Lifecycle::RequestScoped); β”‚ Β·  ────────┬─────── @@ -110,7 +110,7 @@ β”‚ You can only return a response from request handlers, middlewares or error β”‚ handlers. β”‚ - β”‚ ╭─[src/lib.rs:76:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:76:1] β”‚ 76 β”‚ bp.constructor(f!(crate::error), Lifecycle::RequestScoped); β”‚ 77 β”‚ bp.constructor(f!(crate::response), Lifecycle::RequestScoped); β”‚ Β·  ─────────┬───────── @@ -123,7 +123,7 @@ β”‚ `pavex::request::RequestHead` is a framework primitive, you can't override β”‚ the way it's built by Pavex. β”‚ - β”‚ ╭─[src/lib.rs:77:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:77:1] β”‚ 77 β”‚ bp.constructor(f!(crate::response), Lifecycle::RequestScoped); β”‚ 78 β”‚ bp.constructor(f!(crate::request_head), Lifecycle::RequestScoped); β”‚ Β·  ───────────┬─────────── @@ -136,7 +136,7 @@ β”‚ `pavex::router::AllowedMethods` is a framework primitive, you can't β”‚ override the way it's built by Pavex. β”‚ - β”‚ ╭─[src/lib.rs:78:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:78:1] β”‚ 78 β”‚ bp.constructor(f!(crate::request_head), Lifecycle::RequestScoped); β”‚ 79 β”‚ bp.constructor(f!(crate::allowed_methods), Lifecycle::RequestScoped); β”‚ Β·  ─────────────┬──────────── @@ -150,7 +150,7 @@ β”‚ `pavex::request::body::RawIncomingBody` is a framework primitive, you β”‚ can't override the way it's built by Pavex. β”‚ - β”‚ ╭─[src/lib.rs:79:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:79:1] β”‚ 79 β”‚ bp.constructor(f!(crate::allowed_methods), Lifecycle::RequestScoped); β”‚ 80 β”‚ bp.constructor(f!(crate::raw_incoming_body), Lifecycle::RequestScoped); β”‚ Β·  ──────────────┬───────────── @@ -164,7 +164,7 @@ β”‚ `pavex::request::path::MatchedPathPattern` is a framework primitive, you β”‚ can't override the way it's built by Pavex. β”‚ - β”‚ ╭─[src/lib.rs:80:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:80:1] β”‚ 80 β”‚ bp.constructor(f!(crate::raw_incoming_body), Lifecycle::RequestScoped); β”‚ 81 β”‚ bp.constructor(f!(crate::matched_path_pattern), Lifecycle::RequestScoped); β”‚ Β·  ───────────────┬─────────────── @@ -178,7 +178,7 @@ β”‚ `pavex::request::path::RawPathParams<'server, 'request>` is a framework β”‚ primitive, you can't override the way it's built by Pavex. β”‚ - β”‚ ╭─[src/lib.rs:81:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:81:1] β”‚ 81 β”‚ bp.constructor(f!(crate::matched_path_pattern), Lifecycle::RequestScoped); β”‚ 82 β”‚ bp.constructor(f!(crate::raw_path_params), Lifecycle::RequestScoped); β”‚ Β·  ─────────────┬──────────── @@ -191,7 +191,7 @@ β”‚ `pavex::connection::ConnectionInfo` is a framework primitive, you can't β”‚ override the way it's built by Pavex. β”‚ - β”‚ ╭─[src/lib.rs:82:1] + β”‚ ╭─[dependency_injection/some_types_cannot_be_constructed/src/lib.rs:82:1] β”‚ 82 β”‚ bp.constructor(f!(crate::raw_path_params), Lifecycle::RequestScoped); β”‚ 83 β”‚ bp.constructor(f!(crate::connection_info), Lifecycle::RequestScoped); β”‚ Β·  ─────────────┬──────────── diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/stderr.txt index 52a6944c4..87a92d73b 100644 --- a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/stderr.txt @@ -1,10 +1,11 @@ ERROR: Γ— Error observers can't depend on a type with a fallible constructor, either β”‚ directly or transitively. - β”‚ `app::error_observer` violates this constraints! It depends on `app::A`, - β”‚ which is built with `app::a`, a fallible constructor. + β”‚ `app::error_observer` violates this constraints! It depends + β”‚ on `app::A`, which is built with `app::a`, a fallible + β”‚ constructor. β”‚ - β”‚ ╭─[src/lib.rs:45:1] + β”‚ ╭─[error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs:45:1] β”‚ 45 β”‚ .error_handler(f!(crate::error_handler)); β”‚ 46 β”‚ bp.error_observer(f!(crate::error_observer)); β”‚ Β·  ────────────┬──────────── diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/stderr.txt index cd4c264ff..3cad56180 100644 --- a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/stderr.txt @@ -1,11 +1,11 @@ ERROR: Γ— Error observers can't depend on a type with a fallible constructor, either β”‚ directly or transitively. - β”‚ `app::error_observer` violates this constraints! It depends on `app::A`, - β”‚ which depends on `&app::C`, which is built with `app::c`, a fallible - β”‚ constructor. + β”‚ `app::error_observer` violates this constraints! It depends on + β”‚ `app::A`, which depends on `&app::C`, which is built + β”‚ with `app::c`, a fallible constructor. β”‚ - β”‚ ╭─[src/lib.rs:51:1] + β”‚ ╭─[error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs:51:1] β”‚ 51 β”‚ .error_handler(f!(crate::error_handler)); β”‚ 52 β”‚ bp.error_observer(f!(crate::error_observer)); β”‚ Β·  ────────────┬──────────── diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/expectations/app.rs index fad6877ad..7c0ef5580 100644 --- a/libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/expectations/app.rs @@ -161,7 +161,9 @@ pub mod route_0 { } } pub mod route_1 { - pub async fn entrypoint<'a>(s_0: &'a app::Spy) -> pavex::response::Response { + pub async fn entrypoint<'a>( + s_0: &'a app::Spy, + ) -> pavex::response::Response { let response = wrapping_0(s_0).await; response } @@ -293,7 +295,9 @@ pub mod route_1 { } } pub mod route_2 { - pub async fn entrypoint<'a>(s_0: &'a app::Spy) -> pavex::response::Response { + pub async fn entrypoint<'a>( + s_0: &'a app::Spy, + ) -> pavex::response::Response { let response = wrapping_0(s_0).await; response } @@ -425,7 +429,9 @@ pub mod route_2 { } } pub mod route_3 { - pub async fn entrypoint<'a>(s_0: &'a app::Spy) -> pavex::response::Response { + pub async fn entrypoint<'a>( + s_0: &'a app::Spy, + ) -> pavex::response::Response { let response = wrapping_0(s_0).await; response } @@ -511,7 +517,9 @@ pub mod route_3 { } } pub mod route_4 { - pub async fn entrypoint<'a>(s_0: &'a app::Spy) -> pavex::response::Response { + pub async fn entrypoint<'a>( + s_0: &'a app::Spy, + ) -> pavex::response::Response { let response = wrapping_0(s_0).await; response } diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/expectations/app.rs index e9583364c..ac65c055e 100644 --- a/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/expectations/app.rs @@ -103,7 +103,10 @@ pub mod route_0 { let v5 = app::mw(v4, v2); ::into_response(v5) } - async fn handler(v0: &app::C, v1: &app::A) -> pavex::response::Response { + async fn handler( + v0: &app::C, + v1: &app::A, + ) -> pavex::response::Response { let v2 = app::handler(v1, v0); ::into_response(v2) } diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_non_existing_fields/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_non_existing_fields/expectations/stderr.txt index 28a58a722..3c204cb46 100644 --- a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_non_existing_fields/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_non_existing_fields/expectations/stderr.txt @@ -1,18 +1,18 @@ ERROR: Γ— `app::missing_one` is trying to extract path parameters using β”‚ `PathParams`. - β”‚ Every struct field in `app::MissingOne` must be named after one of the - β”‚ route parameters that appear in `/a/:x`: + β”‚ Every struct field in `app::MissingOne` must be named after one + β”‚ of the route parameters that appear in `/a/:x`: β”‚ - `x` β”‚ β”‚ There is no path parameter named `y`, but there is a struct field named β”‚ `y` in `app::MissingOne`. This is going to cause a runtime error! β”‚ - β”‚ ╭─[src/lib.rs:44:1] + β”‚ ╭─[path_parameters/path_parameters_non_existing_fields/src/lib.rs:44:1] β”‚ 44 β”‚ )); β”‚ 45 β”‚ bp.route(GET, "/a/:x", f!(crate::missing_one)); β”‚ Β·  ───────────┬────────── - β”‚ Β· The request handler asking for `PathParams` + β”‚ Β· The request handler asking for `PathParams` β”‚ 46 β”‚ bp.route(GET, "/b/:x", f!(crate::missing_two)); β”‚ ╰──── β”‚  help: Remove or rename the fields that do not map to a valid path @@ -21,18 +21,19 @@ ERROR: Γ— `app::missing_two` is trying to extract path parameters using β”‚ `PathParams`. - β”‚ Every struct field in `app::MissingTwo` must be named after one of the - β”‚ route parameters that appear in `/b/:x`: + β”‚ Every struct field in `app::MissingTwo` must be named after one + β”‚ of the route parameters that appear in `/b/:x`: β”‚ - `x` β”‚ β”‚ There are no path parameters named `y` or `z`, but they appear as field - β”‚ names in `app::MissingTwo`. This is going to cause a runtime error! + β”‚ names in `app::MissingTwo`. This is going to cause a runtime + β”‚ error! β”‚ - β”‚ ╭─[src/lib.rs:45:1] + β”‚ ╭─[path_parameters/path_parameters_non_existing_fields/src/lib.rs:45:1] β”‚ 45 β”‚ bp.route(GET, "/a/:x", f!(crate::missing_one)); β”‚ 46 β”‚ bp.route(GET, "/b/:x", f!(crate::missing_two)); β”‚ Β·  ───────────┬────────── - β”‚ Β· The request handler asking for `PathParams` + β”‚ Β· The request handler asking for `PathParams` β”‚ 47 β”‚ bp.route(GET, "/c", f!(crate::no_path_params)); β”‚ ╰──── β”‚  help: Remove or rename the fields that do not map to a valid path @@ -43,11 +44,11 @@ β”‚ `PathParams`. β”‚ But there are no path parameters in `/c`, the corresponding path pattern! β”‚ - β”‚ ╭─[src/lib.rs:46:1] + β”‚ ╭─[path_parameters/path_parameters_non_existing_fields/src/lib.rs:46:1] β”‚ 46 β”‚ bp.route(GET, "/b/:x", f!(crate::missing_two)); β”‚ 47 β”‚ bp.route(GET, "/c", f!(crate::no_path_params)); β”‚ Β·  ────────────┬──────────── - β”‚ Β· The request handler asking for `PathParams` + β”‚ Β· The request handler asking for `PathParams` β”‚ 48 β”‚ bp β”‚ ╰──── β”‚  help: Stop trying to extract path parameters, or add them to the path diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_unsupported_types/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_unsupported_types/expectations/stderr.txt index a61d4e1cf..7184e4382 100644 --- a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_unsupported_types/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_unsupported_types/expectations/stderr.txt @@ -2,11 +2,12 @@ Γ— Path parameters must be extracted using a plain struct with named fields, β”‚ where the name of each field matches one of the path parameters specified β”‚ in the route for the respective request handler. - β”‚ `app::primitive` is trying to extract `PathParams`, but `u32` is a - β”‚ primitive, not a plain struct type. I don't support this: the extraction - β”‚ would fail at runtime, when trying to process an incoming request. + β”‚ `app::primitive` is trying to extract `PathParams`, but + β”‚ `u32` is a primitive, not a plain struct type. I don't support this: + β”‚ the extraction would fail at runtime, when trying to process an incoming + β”‚ request. β”‚ - β”‚ ╭─[src/lib.rs:61:1] + β”‚ ╭─[path_parameters/path_parameters_unsupported_types/src/lib.rs:61:1] β”‚ 61 β”‚ )); β”‚ 62 β”‚ bp.route(GET, "/a/:x", f!(crate::primitive)); β”‚ Β·  ──────────┬───────── @@ -20,12 +21,12 @@ Γ— Path parameters must be extracted using a plain struct with named fields, β”‚ where the name of each field matches one of the path parameters specified β”‚ in the route for the respective request handler. - β”‚ `app::tuple` is trying to extract `PathParams<(u32, u32)>`, but `(u32, - β”‚ u32)` is a tuple, not a plain struct type. I don't support this: the - β”‚ extraction would fail at runtime, when trying to process an incoming + β”‚ `app::tuple` is trying to extract `PathParams<(u32, u32)>`, but + β”‚ `(u32, u32)` is a tuple, not a plain struct type. I don't support this: + β”‚ the extraction would fail at runtime, when trying to process an incoming β”‚ request. β”‚ - β”‚ ╭─[src/lib.rs:62:1] + β”‚ ╭─[path_parameters/path_parameters_unsupported_types/src/lib.rs:62:1] β”‚ 62 β”‚ bp.route(GET, "/a/:x", f!(crate::primitive)); β”‚ 63 β”‚ bp.route(GET, "/b/:x/:y", f!(crate::tuple)); β”‚ Β·  ────────┬─────── @@ -39,12 +40,12 @@ Γ— Path parameters must be extracted using a plain struct with named fields, β”‚ where the name of each field matches one of the path parameters specified β”‚ in the route for the respective request handler. - β”‚ `app::slice_ref` is trying to extract `PathParams<&[u32]>`, but `&[u32]` - β”‚ is a reference, not a plain struct type. I don't support this: the - β”‚ extraction would fail at runtime, when trying to process an incoming + β”‚ `app::slice_ref` is trying to extract `PathParams<&[u32]>`, but + β”‚ `&[u32]` is a reference, not a plain struct type. I don't support this: + β”‚ the extraction would fail at runtime, when trying to process an incoming β”‚ request. β”‚ - β”‚ ╭─[src/lib.rs:63:1] + β”‚ ╭─[path_parameters/path_parameters_unsupported_types/src/lib.rs:63:1] β”‚ 63 β”‚ bp.route(GET, "/b/:x/:y", f!(crate::tuple)); β”‚ 64 β”‚ bp.route(GET, "/c/:x/:z", f!(crate::slice_ref)); β”‚ Β·  ──────────┬───────── @@ -59,15 +60,15 @@ β”‚ where the name of each field matches one of the path parameters specified β”‚ in the route for the respective request handler. β”‚ `app::reference::` is trying to extract - β”‚ `PathParams<&app::MyStruct>`, but `&app::MyStruct` is a reference, not - β”‚ a plain struct type. I don't support this: the extraction would fail at - β”‚ runtime, when trying to process an incoming request. + β”‚ `PathParams<&app::MyStruct>`, but `&app::MyStruct` is a + β”‚ reference, not a plain struct type. I don't support this: the extraction + β”‚ would fail at runtime, when trying to process an incoming request. β”‚ - β”‚ ╭─[src/lib.rs:64:1] + β”‚ ╭─[path_parameters/path_parameters_unsupported_types/src/lib.rs:64:1] β”‚ 64 β”‚ bp.route(GET, "/c/:x/:z", f!(crate::slice_ref)); β”‚ 65 β”‚ bp.route(GET, "/d/:x/:y", f!(crate::reference::)); β”‚ Β·  ───────────────────┬─────────────────── - β”‚ Β· The request handler asking for `PathParams<&app::MyStruct>` + β”‚ Β· The request handler asking for `PathParams<&app::MyStruct>` β”‚ 66 β”‚ bp.route(GET, "/e/:x/:y", f!(crate::enum_)); β”‚ ╰──── β”‚  help: Use a plain struct with named fields to extract path parameters. @@ -77,16 +78,16 @@ Γ— Path parameters must be extracted using a plain struct with named fields, β”‚ where the name of each field matches one of the path parameters specified β”‚ in the route for the respective request handler. - β”‚ `app::enum_` is trying to extract `PathParams`, but - β”‚ `app::MyEnum` is an enum, not a plain struct type. I don't support this: - β”‚ the extraction would fail at runtime, when trying to process an incoming - β”‚ request. + β”‚ `app::enum_` is trying to extract + β”‚ `PathParams`, but `app::MyEnum` is an enum, + β”‚ not a plain struct type. I don't support this: the extraction would fail + β”‚ at runtime, when trying to process an incoming request. β”‚ - β”‚ ╭─[src/lib.rs:65:1] + β”‚ ╭─[path_parameters/path_parameters_unsupported_types/src/lib.rs:65:1] β”‚ 65 β”‚ bp.route(GET, "/d/:x/:y", f!(crate::reference::)); β”‚ 66 β”‚ bp.route(GET, "/e/:x/:y", f!(crate::enum_)); β”‚ Β·  ────────┬─────── - β”‚ Β· The request handler asking for `PathParams` + β”‚ Β· The request handler asking for `PathParams` β”‚ 67 β”‚ bp.route(GET, "/f/:x/:y", f!(crate::tuple_struct)); β”‚ ╰──── β”‚  help: Use a plain struct with named fields to extract path parameters. @@ -96,16 +97,17 @@ Γ— Path parameters must be extracted using a plain struct with named fields, β”‚ where the name of each field matches one of the path parameters specified β”‚ in the route for the respective request handler. - β”‚ `app::tuple_struct` is trying to extract `PathParams`, - β”‚ but `app::TupleStruct` is a tuple struct, not a plain struct type. I don't - β”‚ support this: the extraction would fail at runtime, when trying to process - β”‚ an incoming request. + β”‚ `app::tuple_struct` is trying to extract + β”‚ `PathParams`, but `app::TupleStruct` + β”‚ is a tuple struct, not a plain struct type. I don't support this: the + β”‚ extraction would fail at runtime, when trying to process an incoming + β”‚ request. β”‚ - β”‚ ╭─[src/lib.rs:66:1] + β”‚ ╭─[path_parameters/path_parameters_unsupported_types/src/lib.rs:66:1] β”‚ 66 β”‚ bp.route(GET, "/e/:x/:y", f!(crate::enum_)); β”‚ 67 β”‚ bp.route(GET, "/f/:x/:y", f!(crate::tuple_struct)); β”‚ Β·  ───────────┬─────────── - β”‚ Β· The request handler asking for `PathParams` + β”‚ Β· The request handler asking for `PathParams` β”‚ 68 β”‚ bp.route(GET, "/g/:x/:y", f!(crate::unit_struct)); β”‚ ╰──── β”‚  help: Use a plain struct with named fields to extract path parameters. @@ -115,16 +117,17 @@ Γ— Path parameters must be extracted using a plain struct with named fields, β”‚ where the name of each field matches one of the path parameters specified β”‚ in the route for the respective request handler. - β”‚ `app::unit_struct` is trying to extract `PathParams`, - β”‚ but `app::UnitStruct` is a struct with no fields (a.k.a. unit struct), not - β”‚ a plain struct type. I don't support this: the extraction would fail at - β”‚ runtime, when trying to process an incoming request. + β”‚ `app::unit_struct` is trying to extract + β”‚ `PathParams`, but `app::UnitStruct` is + β”‚ a struct with no fields (a.k.a. unit struct), not a plain struct type. I + β”‚ don't support this: the extraction would fail at runtime, when trying to + β”‚ process an incoming request. β”‚ - β”‚ ╭─[src/lib.rs:67:1] + β”‚ ╭─[path_parameters/path_parameters_unsupported_types/src/lib.rs:67:1] β”‚ 67 β”‚ bp.route(GET, "/f/:x/:y", f!(crate::tuple_struct)); β”‚ 68 β”‚ bp.route(GET, "/g/:x/:y", f!(crate::unit_struct)); β”‚ Β·  ───────────┬────────── - β”‚ Β· The request handler asking for `PathParams` + β”‚ Β· The request handler asking for `PathParams` β”‚ 69 β”‚ bp β”‚ ╰──── β”‚  help: Use a plain struct with named fields to extract path parameters. diff --git a/libs/pavex_cli/tests/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/expectations/stderr.txt index 93b02cad1..b86bc5161 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/expectations/stderr.txt @@ -1,7 +1,7 @@ ERROR: Γ— `self::my_f()` is not a valid import path. β”‚ - β”‚ ╭─[src/lib.rs:7:1] + β”‚ ╭─[reflection/a_fix_is_suggested_for_function_invocations/src/lib.rs:7:1] β”‚ 7 β”‚ let mut bp = Blueprint::new(); β”‚ 8 β”‚ bp.route(POST, "/home", f!(self::my_f())); β”‚ Β·  ────────┬─────── diff --git a/libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/expectations/app.rs index b757807f5..99900fc13 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/expectations/app.rs @@ -94,7 +94,9 @@ pub mod route_0 { let v3 = pavex::middleware::wrap_noop(v2).await; ::into_response(v3) } - async fn handler(v0: &alloc::sync::Arc) -> pavex::response::Response { + async fn handler( + v0: &alloc::sync::Arc, + ) -> pavex::response::Response { let v1 = app::handler(v0); ::into_response(v1) } diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/app.rs index 50999333f..b79bfdca0 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/app.rs @@ -85,7 +85,7 @@ pub mod route_0 { } async fn handler() -> pavex::response::Response { let v1 = { - let v0 = dep::new_logger(); + let v0 = dep_39415e2f::new_logger(); app::handler(v0) }; ::into_response(v1) diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/diagnostics.dot b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/diagnostics.dot index 675509f30..68dab7c8c 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/diagnostics.dot +++ b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/diagnostics.dot @@ -9,8 +9,8 @@ digraph "GET /home - 0" { } digraph "GET /home - 1" { - 0 [ label = "app::handler(dep::Logger) -> pavex::response::Response"] - 1 [ label = "dep::new_logger() -> dep::Logger"] + 0 [ label = "app::handler(dep_39415e2f::Logger) -> pavex::response::Response"] + 1 [ label = "dep_39415e2f::new_logger() -> dep_39415e2f::Logger"] 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] 1 -> 0 [ ] 0 -> 2 [ ] diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/expectations/stderr.txt index 38e5002dd..e7ec7627e 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/expectations/stderr.txt @@ -1,7 +1,7 @@ ERROR: Γ— `new_logger` is not a fully-qualified import path. β”‚ - β”‚ ╭─[src/lib.rs:10:1] + β”‚ ╭─[reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/lib.rs:10:1] β”‚ 10 β”‚ let mut bp = Blueprint::new(); β”‚ 11 β”‚ bp.constructor(f!(new_logger), Lifecycle::Singleton); β”‚ Β·  ───────┬────── diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/app.rs index 189dfaf42..307b6552a 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/app.rs @@ -84,9 +84,9 @@ pub mod route_0 { ::into_response(v2) } async fn handler() -> pavex::response::Response { - let v0 = dep::header2(); - let v1 = dep::header1(); - let v2 = dep::handler(v1, v0); + let v0 = dep_a0f4586a::header2(); + let v1 = dep_a0f4586a::header1(); + let v2 = dep_a0f4586a::handler(v1, v0); ::into_response(v2) } struct Next0 diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/diagnostics.dot b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/diagnostics.dot index e43878a63..a7d1b1efe 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/diagnostics.dot +++ b/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/diagnostics.dot @@ -9,9 +9,9 @@ digraph "GET /handler - 0" { } digraph "GET /handler - 1" { - 0 [ label = "dep::handler(http_0_1_21::header::HeaderName, http_0_2_12::HeaderName) -> pavex::response::Response"] - 1 [ label = "dep::header1() -> http_0_1_21::header::HeaderName"] - 2 [ label = "dep::header2() -> http_0_2_12::HeaderName"] + 0 [ label = "dep_a0f4586a::handler(http_0_1_21::header::HeaderName, http_0_2_12::HeaderName) -> pavex::response::Response"] + 1 [ label = "dep_a0f4586a::header1() -> http_0_1_21::header::HeaderName"] + 2 [ label = "dep_a0f4586a::header2() -> http_0_2_12::HeaderName"] 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] 2 -> 0 [ ] 1 -> 0 [ ] diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/app.rs index 7595a49f5..61012553c 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/app.rs @@ -85,7 +85,9 @@ pub mod route_0 { } async fn handler() -> pavex::response::Response { let v0 = app::handler(); - as pavex::response::IntoResponse>::into_response(v0) + as pavex::response::IntoResponse>::into_response(v0) } struct Next0 where diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/diagnostics.dot b/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/diagnostics.dot index 069f00afe..a475daf22 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/diagnostics.dot +++ b/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/diagnostics.dot @@ -9,8 +9,8 @@ digraph "GET /home - 0" { } digraph "GET /home - 1" { - 0 [ label = "app::handler() -> dep::Custom"] - 1 [ label = " as pavex::response::IntoResponse>::into_response(dep::Custom) -> pavex::response::Response"] + 0 [ label = "app::handler() -> dep_dcb9931d::Custom"] + 1 [ label = " as pavex::response::IntoResponse>::into_response(dep_dcb9931d::Custom) -> pavex::response::Response"] 0 -> 1 [ ] } diff --git a/libs/pavex_cli/tests/ui_tests/reflection/invalid_callable_path/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/reflection/invalid_callable_path/expectations/stderr.txt index 85add70a8..fdde01b0f 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/invalid_callable_path/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/reflection/invalid_callable_path/expectations/stderr.txt @@ -1,7 +1,7 @@ ERROR: Γ— `my_f,` is not a valid import path. β”‚ - β”‚ ╭─[src/lib.rs:12:1] + β”‚ ╭─[reflection/invalid_callable_path/src/lib.rs:12:1] β”‚ 12 β”‚ }; β”‚ 13 β”‚ bp.route(POST, "/home", callable); β”‚ Β·  ────┬─── diff --git a/libs/pavex_cli/tests/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/expectations/stderr.txt index 13c836da5..58737e835 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/expectations/stderr.txt @@ -1,7 +1,7 @@ ERROR: Γ— `handler` is not a fully-qualified import path. β”‚ - β”‚ ╭─[src/lib.rs:9:1] + β”‚ ╭─[reflection/local_callable_paths_must_be_prefixed_with_crate/src/lib.rs:9:1] β”‚  9 β”‚ let mut bp = Blueprint::new(); β”‚ 10 β”‚ bp.route(GET, "/home", f!(handler)); β”‚ Β·  ─────┬───── diff --git a/libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/expectations/app.rs index 9a5b70dc1..07a738809 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/expectations/app.rs @@ -77,7 +77,9 @@ pub mod route_0 { let response = wrapping_0(s_0).await; response } - async fn stage_1<'a>(s_0: &'a app::LoggerFactory) -> pavex::response::Response { + async fn stage_1<'a>( + s_0: &'a app::LoggerFactory, + ) -> pavex::response::Response { let response = handler(s_0).await; response } diff --git a/libs/pavex_cli/tests/ui_tests/reflection/output_parameter_cannot_be_handled/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/reflection/output_parameter_cannot_be_handled/expectations/stderr.txt index b782b2858..ac5d2a5fa 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/output_parameter_cannot_be_handled/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/reflection/output_parameter_cannot_be_handled/expectations/stderr.txt @@ -1,14 +1,14 @@ ERROR: Γ— I don't know how to handle the type returned by `app::c`. β”‚ - β”‚ ╭─[src/lib.rs:9:1] + β”‚ ╭─[reflection/output_parameter_cannot_be_handled/src/lib.rs:9:1] β”‚  9 β”‚ let mut bp = Blueprint::new(); β”‚ 10 β”‚ bp.route(GET, "/home", f!(crate::c)); β”‚ Β·  ──────┬───── β”‚ Β· The request handler was registered here β”‚ 11 β”‚ bp β”‚ ╰──── - β”‚ ╭─[src/lib.rs:3:1] + β”‚ ╭─[reflection/output_parameter_cannot_be_handled/src/lib.rs:3:1] β”‚ 3 β”‚ β”‚ 4 β”‚ pub fn c() -> Box { β”‚ Β·  ─────────────┬──────────── diff --git a/libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/app.rs index bf8a29b50..4a489b5cf 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/app.rs @@ -71,7 +71,9 @@ async fn route_request( } } pub mod route_0 { - pub async fn entrypoint<'a>(s_0: &'a app::Streamer) -> pavex::response::Response { + pub async fn entrypoint<'a>( + s_0: &'a app::Streamer, + ) -> pavex::response::Response { let response = wrapping_0(s_0).await; response } diff --git a/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/app.rs index 84e0f6d1b..e3a2fc89c 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/app.rs @@ -7,7 +7,7 @@ struct ServerState { application_state: ApplicationState, } pub struct ApplicationState { - s0: dep::Surreal, + s0: dep_065fd341::Surreal, } pub async fn build_application_state() -> crate::ApplicationState { let v0 = app::constructor(); @@ -72,19 +72,19 @@ async fn route_request( } pub mod route_0 { pub async fn entrypoint<'a>( - s_0: &'a dep::Surreal, + s_0: &'a dep_065fd341::Surreal, ) -> pavex::response::Response { let response = wrapping_0(s_0).await; response } async fn stage_1<'a>( - s_0: &'a dep::Surreal, + s_0: &'a dep_065fd341::Surreal, ) -> pavex::response::Response { let response = handler(s_0).await; response } async fn wrapping_0( - v0: &dep::Surreal, + v0: &dep_065fd341::Surreal, ) -> pavex::response::Response { let v1 = crate::route_0::Next0 { s_0: v0, @@ -94,7 +94,9 @@ pub mod route_0 { let v3 = pavex::middleware::wrap_noop(v2).await; ::into_response(v3) } - async fn handler(v0: &dep::Surreal) -> pavex::response::Response { + async fn handler( + v0: &dep_065fd341::Surreal, + ) -> pavex::response::Response { let v1 = app::handler(v0); ::into_response(v1) } @@ -102,8 +104,8 @@ pub mod route_0 { where T: std::future::Future, { - s_0: &'a dep::Surreal, - next: fn(&'a dep::Surreal) -> T, + s_0: &'a dep_065fd341::Surreal, + next: fn(&'a dep_065fd341::Surreal) -> T, } impl<'a, T> std::future::IntoFuture for Next0<'a, T> where diff --git a/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/diagnostics.dot b/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/diagnostics.dot index 4692f6cc6..aa9cb18de 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/diagnostics.dot +++ b/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/diagnostics.dot @@ -1,9 +1,9 @@ digraph "GET / - 0" { 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] - 2 [ label = "crate::route_0::Next0(&'a dep::Surreal) -> crate::route_0::Next0<'a>"] + 2 [ label = "crate::route_0::Next0(&'a dep_065fd341::Surreal) -> crate::route_0::Next0<'a>"] 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] - 5 [ label = "&dep::Surreal"] + 5 [ label = "&dep_065fd341::Surreal"] 1 -> 0 [ ] 2 -> 1 [ ] 0 -> 4 [ ] @@ -11,9 +11,9 @@ digraph "GET / - 0" { } digraph "GET / - 1" { - 0 [ label = "app::handler(&dep::Surreal) -> pavex::response::Response"] + 0 [ label = "app::handler(&dep_065fd341::Surreal) -> pavex::response::Response"] 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] - 3 [ label = "&dep::Surreal"] + 3 [ label = "&dep_065fd341::Surreal"] 0 -> 2 [ ] 3 -> 0 [ ] } @@ -39,7 +39,7 @@ digraph "* / - 1" { } digraph app_state { - 0 [ label = "crate::ApplicationState(dep::Surreal) -> crate::ApplicationState"] - 1 [ label = "app::constructor() -> dep::Surreal"] + 0 [ label = "crate::ApplicationState(dep_065fd341::Surreal) -> crate::ApplicationState"] + 1 [ label = "app::constructor() -> dep_065fd341::Surreal"] 1 -> 0 [ ] } \ No newline at end of file diff --git a/libs/pavex_cli/tests/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/expectations/stderr.txt b/libs/pavex_cli/tests/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/expectations/stderr.txt index fe6e38c60..0c21c97b0 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/expectations/stderr.txt +++ b/libs/pavex_cli/tests/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/expectations/stderr.txt @@ -1,7 +1,7 @@ ERROR: Γ— `String` is not a fully-qualified import path. β”‚ - β”‚ ╭─[src/lib.rs:15:1] + β”‚ ╭─[reflection/the_path_for_generic_arguments_must_be_absolute/src/lib.rs:15:1] β”‚ 15 β”‚ let mut bp = Blueprint::new(); β”‚ 16 β”‚ bp.constructor(f!(crate::new_logger::), Lifecycle::Singleton); β”‚ Β·  ───────────────┬─────────────── diff --git a/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/expectations/app.rs index 7f7a97f6a..1af8c7177 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/expectations/app.rs @@ -85,9 +85,15 @@ pub mod route_0 { } async fn handler() -> pavex::response::Response { let v0 = ::a_method_that_returns_self(); - let v1 = ::a_method_that_borrows_self(&v0); - let v2 = ::a_method_that_consumes_self(v1); - let v3 = >::a_method(&v2); + let v1 = ::a_method_that_borrows_self( + &v0, + ); + let v2 = ::a_method_that_consumes_self( + v1, + ); + let v3 = >::a_method(&v2); let v4 = ::a_method_with_a_generic::< std::string::String, >(&v0); diff --git a/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/app.rs b/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/app.rs index 17cd8c911..b1b600d40 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/app.rs +++ b/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/app.rs @@ -8,7 +8,7 @@ struct ServerState { } pub struct ApplicationState { s0: (bool, char, u8), - s1: dep::ActualType, + s1: dep_f8f62968::ActualType, } pub async fn build_application_state() -> crate::ApplicationState { let v0 = app::RemoteAlias::new(); @@ -82,21 +82,21 @@ async fn route_request( pub mod route_0 { pub async fn entrypoint<'a>( s_0: (bool, char, u8), - s_1: &'a dep::ActualType, + s_1: &'a dep_f8f62968::ActualType, ) -> pavex::response::Response { let response = wrapping_0(s_0, s_1).await; response } async fn stage_1<'a>( s_0: (bool, char, u8), - s_1: &'a dep::ActualType, + s_1: &'a dep_f8f62968::ActualType, ) -> pavex::response::Response { let response = handler(s_0, s_1).await; response } async fn wrapping_0( v0: (bool, char, u8), - v1: &dep::ActualType, + v1: &dep_f8f62968::ActualType, ) -> pavex::response::Response { let v2 = crate::route_0::Next0 { s_0: v0, @@ -109,7 +109,7 @@ pub mod route_0 { } async fn handler( v0: (bool, char, u8), - v1: &dep::ActualType, + v1: &dep_f8f62968::ActualType, ) -> pavex::response::Response { let v2 = app::handler_with_input_tuple(v0, v1); ::into_response(v2) @@ -119,8 +119,8 @@ pub mod route_0 { T: std::future::Future, { s_0: (bool, char, u8), - s_1: &'a dep::ActualType, - next: fn((bool, char, u8), &'a dep::ActualType) -> T, + s_1: &'a dep_f8f62968::ActualType, + next: fn((bool, char, u8), &'a dep_f8f62968::ActualType) -> T, } impl<'a, T> std::future::IntoFuture for Next0<'a, T> where diff --git a/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/diagnostics.dot b/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/diagnostics.dot index 16adbdae0..ae7fc8cce 100644 --- a/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/diagnostics.dot +++ b/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/diagnostics.dot @@ -1,10 +1,10 @@ digraph "GET /home - 0" { 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] - 2 [ label = "crate::route_0::Next0((bool, char, u8), &'a dep::ActualType) -> crate::route_0::Next0<'a>"] + 2 [ label = "crate::route_0::Next0((bool, char, u8), &'a dep_f8f62968::ActualType) -> crate::route_0::Next0<'a>"] 3 [ label = "(bool, char, u8)"] 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] - 6 [ label = "&dep::ActualType"] + 6 [ label = "&dep_f8f62968::ActualType"] 1 -> 0 [ ] 2 -> 1 [ ] 3 -> 2 [ ] @@ -13,10 +13,10 @@ digraph "GET /home - 0" { } digraph "GET /home - 1" { - 0 [ label = "app::handler_with_input_tuple((bool, char, u8), &dep::ActualType) -> pavex::response::Response"] + 0 [ label = "app::handler_with_input_tuple((bool, char, u8), &dep_f8f62968::ActualType) -> pavex::response::Response"] 1 [ label = "(bool, char, u8)"] 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] - 4 [ label = "&dep::ActualType"] + 4 [ label = "&dep_f8f62968::ActualType"] 1 -> 0 [ ] 0 -> 3 [ ] 4 -> 0 [ ] @@ -43,9 +43,9 @@ digraph "* /home - 1" { } digraph app_state { - 0 [ label = "crate::ApplicationState((bool, char, u8), dep::ActualType) -> crate::ApplicationState"] + 0 [ label = "crate::ApplicationState((bool, char, u8), dep_f8f62968::ActualType) -> crate::ApplicationState"] 1 [ label = "app::constructor_with_output_tuple() -> (bool, char, u8)"] - 2 [ label = "app::RemoteAlias::new() -> dep::ActualType"] + 2 [ label = "app::RemoteAlias::new() -> dep_f8f62968::ActualType"] 2 -> 0 [ ] 1 -> 0 [ ] } \ No newline at end of file diff --git a/libs/pavex_test_runner/Cargo.toml b/libs/pavex_test_runner/Cargo.toml index fbe509461..e2f94be29 100644 --- a/libs/pavex_test_runner/Cargo.toml +++ b/libs/pavex_test_runner/Cargo.toml @@ -11,10 +11,6 @@ publish = false [package.metadata.dist] dist = false -[[bin]] -path = "src/main.rs" -name = "snaps" - [dependencies] anyhow = { workspace = true } ahash = { workspace = true } @@ -38,3 +34,5 @@ tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] } regex = { workspace = true } once_cell = { workspace = true } px_workspace_hack = { version = "0.1", path = "../px_workspace_hack" } +pavexc = { path = "../pavexc" } +guppy = { workspace = true } diff --git a/libs/pavex_test_runner/src/lib.rs b/libs/pavex_test_runner/src/lib.rs index be8a6604d..ce6891f1f 100644 --- a/libs/pavex_test_runner/src/lib.rs +++ b/libs/pavex_test_runner/src/lib.rs @@ -1,18 +1,22 @@ +#![allow(dead_code)] +use std::collections::BTreeMap; use std::fmt::Write; -use std::path::{Path, PathBuf}; -use std::process::Output; +use std::path::{Component, Path, PathBuf}; +use std::process::{Command, Output}; -use ahash::HashMap; +use ahash::{HashMap, HashSet}; use anyhow::Context; use console::style; use itertools::Itertools; use libtest_mimic::{Conclusion, Failed}; +use pavexc::rustdoc::CrateCollection; +use pavexc::DEFAULT_DOCS_TOOLCHAIN; +use sha2::Digest; use toml::toml; use walkdir::WalkDir; use persist_if_changed::{copy_if_changed, persist_if_changed}; pub use snapshot::print_changeset; -use target_directory::TargetDirectoryPool; use crate::snapshot::SnapshotTest; @@ -28,18 +32,15 @@ pub fn get_ui_test_directories(test_folder: &Path) -> impl Iterator String { - ui_test_folder - .strip_prefix(ui_tests_folder) - .unwrap() +pub fn get_test_name(tests_parent_folder: &Path, test_folder: &Path) -> String { + let relative_path = test_folder.strip_prefix(&tests_parent_folder).unwrap(); + relative_path .components() - .filter_map(|c| { - if let std::path::Component::Normal(s) = c { - Some(s.to_string_lossy().to_string()) - } else { - None - } + .map(|c| { + let Component::Normal(c) = c else { + panic!("Expected a normal component") + }; + c.to_string_lossy() }) .join("::") } @@ -57,39 +58,204 @@ pub fn get_test_name(ui_tests_folder: &Path, ui_test_folder: &Path) -> String { /// Our custom test runner is built on top of `libtest_mimic`, which gives us /// [compatibility out-of-the-box](https://nexte.st/book/custom-test-harnesses.html) with `cargo-nextest`. pub fn run_tests( - pavex_cli_path: PathBuf, - pavexc_cli_path: PathBuf, + pavex_cli: PathBuf, + pavexc_cli: PathBuf, definition_directory: PathBuf, runtime_directory: PathBuf, ) -> Result { let arguments = libtest_mimic::Arguments::from_args(); - let target_directory_pool = TargetDirectoryPool::new(None, &runtime_directory); + let mut test_name2test_data = BTreeMap::new(); + for entry in get_ui_test_directories(&definition_directory) { + let test_name = get_test_name(&definition_directory, &entry); + let relative_path = entry.strip_prefix(&definition_directory).unwrap(); + let test_data = TestData::new( + &test_name, + entry.clone(), + runtime_directory.join(relative_path), + )?; + test_name2test_data.insert(test_name, test_data); + } + + create_tests_dir(&runtime_directory, &test_name2test_data, &pavex_cli)?; + + if !arguments.list { + warm_up_target_dir(&runtime_directory, &test_name2test_data)?; + } let mut tests = Vec::new(); - for entry in get_ui_test_directories(&definition_directory) { - let name = get_test_name(&definition_directory, &entry); - let filename = entry.file_name().unwrap(); - let test_data = TestData { - definition_directory: entry.clone(), - runtime_directory: runtime_directory.join("tests").join(filename), - }; - let test_configuration = test_data - .load_configuration() - .expect("Failed to load test configuration"); - let is_ignored = test_configuration.ignore; - let pavex_cli = pavex_cli_path.clone(); - let pavexc_cli = pavexc_cli_path.clone(); - let pool = target_directory_pool.clone(); - let test = libtest_mimic::Trial::test(name.clone(), move || { - run_test(test_data, test_configuration, pavex_cli, pavexc_cli, pool) - }) - .with_ignored_flag(is_ignored); + for (name, data) in test_name2test_data { + let pavexc_cli = pavexc_cli.clone(); + let runtime_directory = runtime_directory.clone(); + let ignored = data.configuration.ignore; + let test = + libtest_mimic::Trial::test(name, move || run_test(runtime_directory, data, pavexc_cli)) + .with_ignored_flag(ignored); tests.push(test); } Ok(libtest_mimic::run(&arguments, tests)) } +/// Compile all binary targets of the type `app_*`. +/// This ensures that all dependencies have been compiled, speeding up further operations, +/// as well as preparing the binaries that each test will invoke. +fn warm_up_target_dir( + runtime_directory: &Path, + test_name2test_data: &BTreeMap, +) -> Result<(), anyhow::Error> { + println!("Creating a workspace-hack crate to unify dependencies"); + + // Clean up pre-existing workspace_hack, since `cargo hakari init` will fail + // if it already exists. + // let _ = fs_err::remove_dir_all(runtime_directory.join("workspace_hack")); + // let _ = fs_err::remove_file(runtime_directory.join(".config").join("hakari.toml")); + + let mut cmd = Command::new("cargo"); + cmd.arg("hakari") + .arg("init") + .arg("-y") + .arg("workspace_hack") + .current_dir(runtime_directory) + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()); + let status = cmd.status()?; + if !status.success() { + anyhow::bail!("Failed to create workspace_hack crate"); + } + + let mut cmd = Command::new("cargo"); + cmd.arg("hakari") + .arg("generate") + .current_dir(runtime_directory) + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()); + let status = cmd.status()?; + if !status.success() { + anyhow::bail!("Failed to generate workspace_hack crate"); + } + + let mut cmd = Command::new("cargo"); + cmd.arg("hakari") + .arg("manage-deps") + .arg("-y") + .current_dir(runtime_directory) + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()); + let status = cmd.status()?; + if !status.success() { + anyhow::bail!("Failed to manage workspace_hack dependencies"); + } + + let timer = std::time::Instant::now(); + println!("Warming up the target directory"); + let mut cmd = Command::new("cargo"); + cmd.arg("build") + .arg("--bins") + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()) + .current_dir(runtime_directory); + let status = cmd.status()?; + if !status.success() { + anyhow::bail!("Failed to compile the test binaries"); + } + println!( + "Warmed up the target directory in {} seconds", + timer.elapsed().as_secs() + ); + + let timer = std::time::Instant::now(); + // We want to ensure that all invocations of `pavexc generate` hit the cache + // thus avoiding the need to invoke `rustdoc` and acquire a contentious + // lock over the target directory. + println!("Pre-computing JSON documentation for relevant crates"); + let crate_collection = CrateCollection::new( + runtime_directory.to_string_lossy().into_owned(), + DEFAULT_DOCS_TOOLCHAIN.to_owned(), + runtime_directory.to_path_buf(), + )?; + let mut crates = test_name2test_data + .values() + .map(|data| format!("app_{}", data.name_hash)) + .collect::>(); + // Hand-picked crates that we know we're going to build docs for. + crates.insert("pavex".into()); + crates.insert("tracing".into()); + crates.insert("equivalent".into()); + crates.insert("ppv-lite86".into()); + crates.insert("hashbrown".into()); + crates.insert("typenum".into()); + let package_ids = crate_collection + .package_graph() + .packages() + .filter(|p| crates.contains(p.name())) + .map(|p| p.id().to_owned()); + crate_collection + .batch_compute_crates(package_ids) + .context("Failed to warm rustdoc JSON cache")?; + println!( + "Pre-computed JSON documentation in {} seconds", + timer.elapsed().as_secs() + ); + + Ok(()) +} + +fn create_tests_dir( + runtime_directory: &Path, + test_name2test_data: &BTreeMap, + pavex_cli: &Path, +) -> Result<(), anyhow::Error> { + let timer = std::time::Instant::now(); + println!("Seeding the filesystem"); + fs_err::create_dir_all(&runtime_directory) + .context("Failed to create runtime directory for UI tests")?; + + // Create a `Cargo.toml` to define a workspace, + // where each UI test is a workspace member + let cargo_toml_path = runtime_directory.join("Cargo.toml"); + let mut cargo_toml = String::new(); + writeln!(&mut cargo_toml, "[workspace]\nmembers = [").unwrap(); + for test_data in test_name2test_data.values() { + for member in test_data.workspace_members() { + let relative_path = member.strip_prefix(&runtime_directory).unwrap(); + writeln!(cargo_toml, " \"{}\",", relative_path.display()).unwrap(); + } + } + writeln!(&mut cargo_toml, "]").unwrap(); + writeln!(&mut cargo_toml, "resolver = \"2\"").unwrap(); + writeln!(&mut cargo_toml, "[workspace.dependencies]").unwrap(); + writeln!(&mut cargo_toml, "pavex = {{ path = \"../pavex\" }}").unwrap(); + writeln!( + &mut cargo_toml, + "pavex_cli_client = {{ path = \"../pavex_cli_client\" }}" + ) + .unwrap(); + writeln!( + &mut cargo_toml, + "workspace_hack = {{ path = \"workspace_hack\" }}" + ) + .unwrap(); + writeln!(&mut cargo_toml, "tokio = \"1\"").unwrap(); + writeln!(&mut cargo_toml, "reqwest = \"0.12\"").unwrap(); + + persist_if_changed(&cargo_toml_path, cargo_toml.as_bytes())?; + + // Create a manifest for each UI test + // Each UI test is composed of multiple crates, therefore we nest + // everything under a test-specific directory to avoid name + // clashes and confusion across tests + for test_data in test_name2test_data.values() { + test_data.seed_test_filesystem(pavex_cli)?; + } + + println!( + "Seeded the filesystem in {:?}ms", + timer.elapsed().as_millis() + ); + + Ok(()) +} + #[derive(serde::Deserialize)] #[serde(rename_all = "snake_case")] /// Configuration values that can be specified next to the test data to influence how it's going @@ -176,28 +342,55 @@ impl ExpectedOutcome { /// Auxiliary data attached to each test definition for convenient retrieval. /// It's used in [`run_test`]. struct TestData { + name_hash: String, definition_directory: PathBuf, runtime_directory: PathBuf, + configuration: TestConfig, + has_tests: bool, } impl TestData { - /// The directory containing the source code of the project under testβ€”i.e. the blueprint, the generate app - /// and any integration test, if defined. - fn test_runtime_directory(&self) -> PathBuf { - self.runtime_directory.join("project") + fn new( + test_name: &str, + definition_directory: PathBuf, + runtime_directory: PathBuf, + ) -> Result { + let name_hash = { + let mut hasher = sha2::Sha256::default(); + <_ as sha2::Digest>::update(&mut hasher, test_name.as_bytes()); + let full_hash = hasher.finalize(); + // Get the first 8 hex characters of the hash, they should be enough to identify the test + let mut hash = String::new(); + for byte in full_hash.iter().take(4) { + write!(&mut hash, "{:02x}", byte).unwrap(); + } + hash + }; + let configuration = Self::load_configuration(&definition_directory)?; + let integration_test_file = definition_directory.join("test.rs"); + let has_tests = integration_test_file.exists(); + Ok(Self { + name_hash, + definition_directory, + configuration, + runtime_directory, + has_tests, + }) } - /// The directory containing the source code of all ephemeral dependencies. - /// - /// We don't want to list ephemeral dependencies as members of the workspace of the project under test - /// in order to be able to have multiple versions of the same crate as dependencies of the project under test. - /// That would be forbidden by `cargo` if they were listed as members of the same workspace. - fn ephemeral_deps_runtime_directory(&self) -> PathBuf { - self.runtime_directory.join("ephemeral_deps") + fn workspace_members(&self) -> Vec { + let mut members = vec![ + self.blueprint_directory().to_path_buf(), + self.generated_app_directory(), + ]; + if let Some(dir) = self.integration_test_directory() { + members.push(dir.to_path_buf()); + } + members } - fn load_configuration(&self) -> Result { - let path = self.definition_directory.join("test_config.toml"); + fn load_configuration(definition_directory: &Path) -> Result { + let path = definition_directory.join("test_config.toml"); let test_config = fs_err::read_to_string(&path).context( "All UI tests must have an associated `test_config.toml` file with, \ at the very least, a `description` field explaining what the test is trying \ @@ -211,16 +404,38 @@ impl TestData { }) } + /// The directory containing the source code of all ephemeral dependencies. + /// + /// We don't want to list ephemeral dependencies as members of the workspace of the project under test + /// in order to be able to have multiple versions of the same crate as dependencies of the project under test. + /// That would be forbidden by `cargo` if they were listed as members of the same workspace. + fn ephemeral_deps_runtime_directory(&self) -> PathBuf { + self.runtime_directory.join("ephemeral_deps") + } + + fn blueprint_directory(&self) -> &Path { + &self.runtime_directory + } + + fn generated_app_directory(&self) -> PathBuf { + self.runtime_directory.join("generated_app") + } + + fn blueprint_crate_name(&self) -> String { + format!("app_{}", self.name_hash) + } + + fn integration_test_directory(&self) -> Option { + self.has_tests + .then(|| self.runtime_directory.join("integration")) + } + /// Populate the runtime test folder using the directives and the files in the test /// definition folder. - fn seed_test_filesystem( - &self, - test_config: &TestConfig, - cli: &Path, - target_dir: &Path, - ) -> Result { - Self::remove_target_junk(target_dir).context("Failed to clean up target directory")?; - let source_directory = self.test_runtime_directory().join("src"); + fn seed_test_filesystem(&self, pavex_cli: &Path) -> Result<(), anyhow::Error> { + fs_err::create_dir_all(&self.runtime_directory) + .context("Failed to create runtime directory for UI test")?; + let source_directory = self.runtime_directory.join("src"); fs_err::create_dir_all(&source_directory).context( "Failed to create the runtime directory for the project under test when setting up the test runtime environment", )?; @@ -234,7 +449,7 @@ impl TestData { "Failed to create the runtime directory for ephemeral dependencies when setting up the test runtime environment", )?; - for (dependency_name, dependency_config) in &test_config.ephemeral_dependencies { + for (dependency_name, dependency_config) in &self.configuration.ephemeral_dependencies { let dep_runtime_directory = deps_subdir.join(dependency_name); let package_name = dependency_config .package @@ -260,9 +475,9 @@ impl TestData { unexpected_cfgs = { level = "allow", check-cfg = ["cfg(pavex_ide_hint)"] } [dependencies] - pavex ={ path = "../../../../../../libs/pavex" } + pavex = { workspace = true } }; - cargo_toml["package"]["name"] = package_name.into(); + cargo_toml["package"]["name"] = format!("{package_name}_{}", self.name_hash).into(); cargo_toml["package"]["version"] = dependency_config.version.clone().into(); let deps = cargo_toml .get_mut("dependencies") @@ -277,10 +492,8 @@ impl TestData { )?; } - let integration_test_file = self.definition_directory.join("test.rs"); - let has_tests = integration_test_file.exists(); - if has_tests { - let integration_test_directory = self.test_runtime_directory().join("integration"); + if let Some(integration_test_directory) = self.integration_test_directory() { + let integration_test_file = self.definition_directory.join("test.rs"); let integration_test_src_directory = integration_test_directory.join("src"); let integration_test_test_directory = integration_test_directory.join("tests"); fs_err::create_dir_all(&integration_test_src_directory).context( @@ -297,7 +510,7 @@ impl TestData { let mut cargo_toml = toml! { [package] - name = "integration" + name = "dummy" version = "0.1.0" edition = "2021" @@ -306,17 +519,29 @@ impl TestData { app = { path = ".." } [dev-dependencies] - tokio = { version = "1", features = ["full"] } - reqwest = "0.11" - pavex ={ path = "../../../../../../libs/pavex" } + tokio = { workspace = true, features = ["full"] } + reqwest = { workspace = true } + pavex = { workspace = true } }; + cargo_toml["package"]["name"] = format!("integration_{}", self.name_hash).into(); + cargo_toml["dependencies"]["application"] + .as_table_mut() + .unwrap() + .insert( + "package".into(), + format!("application_{}", self.name_hash).into(), + ); + cargo_toml["dependencies"]["app"] + .as_table_mut() + .unwrap() + .insert("package".into(), format!("app_{}", self.name_hash).into()); let dev_deps = cargo_toml .get_mut("dev-dependencies") .unwrap() .as_table_mut() .unwrap(); - dev_deps.extend(test_config.dev_dependencies.clone()); + dev_deps.extend(self.configuration.dev_dependencies.clone()); persist_if_changed( &integration_test_directory.join("Cargo.toml"), @@ -326,16 +551,16 @@ impl TestData { // Generated application crate, ahead of code generation. { - let application_dir = self.test_runtime_directory().join("generated_app"); + let application_dir = self.generated_app_directory(); let application_src_dir = application_dir.join("src"); fs_err::create_dir_all(&application_src_dir).context( "Failed to create the runtime directory for the generated application when setting up the test runtime environment", )?; persist_if_changed(&application_src_dir.join("lib.rs"), b"")?; - let cargo_toml = toml! { + let mut cargo_toml = toml! { [package] - name = "application" + name = "dummy" version = "0.1.0" edition = "2021" @@ -343,6 +568,7 @@ impl TestData { generator_type = "cargo_workspace_binary" generator_name = "app" }; + cargo_toml["package"]["name"] = format!("application_{}", self.name_hash).into(); persist_if_changed( &application_dir.join("Cargo.toml"), toml::to_string(&cargo_toml)?.as_bytes(), @@ -350,11 +576,8 @@ impl TestData { } let mut cargo_toml = toml! { - [workspace] - members = [".", "generated_app"] - [package] - name = "app" + name = "dummy" version = "0.1.0" edition = "2021" @@ -362,61 +585,44 @@ impl TestData { unexpected_cfgs = { level = "allow", check-cfg = ["cfg(pavex_ide_hint)"] } [dependencies] - pavex ={ path = "../../../../../libs/pavex" } - pavex_cli_client = { path = "../../../../../libs/pavex_cli_client" } + pavex = { workspace = true } + pavex_cli_client = { workspace = true } + workspace_hack = { workspace = true } }; - if has_tests { - cargo_toml["workspace"]["members"] - .as_array_mut() - .unwrap() - .push("integration".into()); - } + cargo_toml["package"]["name"] = format!("app_{}", self.name_hash).into(); let deps = cargo_toml .get_mut("dependencies") .unwrap() .as_table_mut() .unwrap(); - deps.extend(test_config.dependencies.clone()); + deps.extend(self.configuration.dependencies.clone()); let ephemeral_dependencies = - test_config + self.configuration .ephemeral_dependencies .iter() .map(|(key, config)| { let mut value = toml::value::Table::new(); - value.insert("path".into(), format!("../ephemeral_deps/{key}").into()); - if let Some(package_name) = config.package.as_ref() { - value.insert("package".into(), package_name.clone().into()); - } + value.insert("path".into(), format!("ephemeral_deps/{key}").into()); + let package_name = if let Some(package_name) = config.package.as_ref() { + package_name.to_owned() + } else { + key.to_owned() + }; + value.insert( + "package".into(), + format!("{package_name}_{}", self.name_hash).into(), + ); (key.to_owned(), toml::Value::Table(value)) }); deps.extend(ephemeral_dependencies); persist_if_changed( - &self.test_runtime_directory().join("Cargo.toml"), + &self.runtime_directory.join("Cargo.toml"), toml::to_string(&cargo_toml)?.as_bytes(), )?; - // - Use the new sparse registry to speed up registry operations. - let mut cargo_config = toml! { - [build] - incremental = false - - [registries.crates-io] - protocol = "sparse" - }; - cargo_config["build"] - .as_table_mut() - .unwrap() - .insert("target-dir".into(), target_dir.to_str().unwrap().into()); - let dot_cargo_folder = self.runtime_directory.join(".cargo"); - fs_err::create_dir_all(&dot_cargo_folder)?; - persist_if_changed( - &dot_cargo_folder.join("config.toml"), - toml::to_string(&cargo_config)?.as_bytes(), - )?; - let main_rs = format!( - r##"use app::blueprint; + r##"use app_{}::blueprint; use pavex_cli_client::{{Client, config::Color}}; use pavex_cli_client::commands::generate::GenerateError; @@ -424,7 +630,7 @@ fn main() -> Result<(), Box> {{ let outcome = Client::new() .color(Color::Always) .pavex_cli_path(r#"{}"#.into()) - .generate(blueprint(), "generated_app".into()) + .generate(blueprint(), "{}".into()) .diagnostics_path("diagnostics.dot".into()) .execute(); match outcome {{ @@ -438,41 +644,20 @@ fn main() -> Result<(), Box> {{ Ok(()) }} "##, - cli.to_str().unwrap() + self.name_hash, + pavex_cli.to_str().unwrap(), + self.runtime_directory.join("generated_app").display(), ); persist_if_changed(&source_directory.join("main.rs"), main_rs.as_bytes())?; - Ok(if has_tests { + Ok(()) + } + + pub fn should_run_tests(&self) -> ShouldRunTests { + if self.has_tests { ShouldRunTests::Yes } else { ShouldRunTests::No - }) - } - - /// Some intermediate artefacts that are left behind by the execution of a previous - /// test case might cause the current test case to fail (e.g. it won't recompile - /// the binary that generated the blueprint file). - /// - /// It's unclear why this happens (`cargo` bug?) but we can work around it by - /// removing the offending artefacts before running the test. - fn remove_target_junk(target_directory: &Path) -> Result<(), anyhow::Error> { - let library_name = "app"; - let walker = globwalk::GlobWalkerBuilder::from_patterns( - target_directory, - &[ - format!("/**/lib{}.*", library_name), - format!("/**/lib{}-*", library_name), - ], - ) - .build()?; - for file in walker { - let file = file?; - if file.file_type().is_file() { - fs_err::remove_file(file.path())?; - } else if file.file_type().is_dir() { - fs_err::remove_dir_all(file.path())?; - } } - Ok(()) } } @@ -481,14 +666,8 @@ enum ShouldRunTests { No, } -fn run_test( - test: TestData, - config: TestConfig, - pavex_cli: PathBuf, - pavexc_cli: PathBuf, - target_dir_pool: TargetDirectoryPool, -) -> Result<(), Failed> { - match _run_test(&config, &test, &pavex_cli, &pavexc_cli, &target_dir_pool) { +fn run_test(runtime_directory: PathBuf, test: TestData, pavexc_cli: PathBuf) -> Result<(), Failed> { + match _run_test(&runtime_directory, &test, &pavexc_cli) { Ok(TestOutcome { outcome: Err(mut msg), codegen_output, @@ -517,10 +696,10 @@ fn run_test( ) .unwrap(); } - enrich_failure_message(&config, msg) + enrich_failure_message(&test.configuration, msg) })), Err(e) => Err(Failed::from(enrich_failure_message( - &config, + &test.configuration, unexpected_failure_message(&e), ))), Ok(TestOutcome { @@ -530,34 +709,30 @@ fn run_test( } fn _run_test( - test_config: &TestConfig, + runtime_directory: &Path, test: &TestData, - pavex_cli: &Path, pavexc_cli: &Path, - target_dir_pool: &TargetDirectoryPool, ) -> Result { - let target_dir = target_dir_pool.pull(); - let should_run_tests = test - .seed_test_filesystem(test_config, pavex_cli, &target_dir) - .context("Failed to seed the filesystem for the test runtime folder")?; - - let output = std::process::Command::new("cargo") - .env("RUSTFLAGS", "-Awarnings") + let binary_name = format!("app_{}", test.name_hash); + let timer = std::time::Instant::now(); + println!("Running {binary_name}"); + let binary = runtime_directory + .join("target") + .join("debug") + .join(&binary_name); + let output = std::process::Command::new(binary) .env("PAVEX_PAVEXC", pavexc_cli) - .arg("run") - .arg("--jobs") - .arg("1") - .arg("--quiet") - .current_dir(&test.test_runtime_directory()) + .current_dir(&test.runtime_directory) .output() .context("Failed to perform code generation")?; + println!("Ran {binary_name} in {} seconds", timer.elapsed().as_secs()); let codegen_output: CommandOutput = (&output).try_into()?; let expectations_directory = test.definition_directory.join("expectations"); if !output.status.success() { - return match test_config.expectations.codegen { + return match test.configuration.expectations.codegen { ExpectedOutcome::Pass => Ok(TestOutcome { outcome: Err("We failed to generate the application code.".to_string()), codegen_output, @@ -565,7 +740,10 @@ fn _run_test( test_output: None, }), ExpectedOutcome::Fail => { - let stderr_snapshot = SnapshotTest::new(expectations_directory.join("stderr.txt")); + let stderr_snapshot = SnapshotTest::new( + expectations_directory.join("stderr.txt"), + test.blueprint_crate_name(), + ); if stderr_snapshot.verify(&codegen_output.stderr).is_err() { return Ok(TestOutcome { outcome: Err("The failure message returned by code generation doesn't match what we expected".into()), @@ -582,7 +760,7 @@ fn _run_test( }) } }; - } else if ExpectedOutcome::Fail == test_config.expectations.codegen { + } else if ExpectedOutcome::Fail == test.configuration.expectations.codegen { return Ok(TestOutcome { outcome: Err("We expected code generation to fail, but it succeeded!".into()), codegen_output, @@ -591,8 +769,11 @@ fn _run_test( }); }; - if let ExpectedOutcome::Fail = test_config.expectations.lints { - let stderr_snapshot = SnapshotTest::new(expectations_directory.join("stderr.txt")); + if let ExpectedOutcome::Fail = test.configuration.expectations.lints { + let stderr_snapshot = SnapshotTest::new( + expectations_directory.join("stderr.txt"), + test.blueprint_crate_name(), + ); if stderr_snapshot.verify(&codegen_output.stderr).is_err() { return Ok(TestOutcome { outcome: Err( @@ -605,35 +786,36 @@ fn _run_test( } } - let diagnostics_snapshot = SnapshotTest::new(expectations_directory.join("diagnostics.dot")); + let diagnostics_snapshot = SnapshotTest::new( + expectations_directory.join("diagnostics.dot"), + test.blueprint_crate_name(), + ); let actual_diagnostics = - fs_err::read_to_string(test.test_runtime_directory().join("diagnostics.dot"))?; + fs_err::read_to_string(test.runtime_directory.join("diagnostics.dot"))?; // We don't exit early here to get the generated code snapshot as well. // This allows to update both code snapshot and diagnostics snapshot in one go via // `cargo r --bin snaps` for a failing test instead of having to do them one at a time, // with a test run in the middle. let diagnostics_outcome = diagnostics_snapshot.verify(&actual_diagnostics); - let app_code_snapshot = SnapshotTest::new(expectations_directory.join("app.rs")); - let actual_app_code = fs_err::read_to_string( - test.test_runtime_directory() - .join("generated_app") - .join("src") - .join("lib.rs"), - ) - .unwrap(); + let app_code_snapshot = SnapshotTest::new( + expectations_directory.join("app.rs"), + test.blueprint_crate_name(), + ); + let generated_code_path = test.generated_app_directory().join("src").join("lib.rs"); + let actual_app_code = fs_err::read_to_string(generated_code_path).unwrap(); let codegen_outcome = app_code_snapshot.verify(&actual_app_code); // Check that the generated code compiles let output = std::process::Command::new("cargo") - .env("RUSTFLAGS", "-Awarnings") + // .env("RUSTFLAGS", "-Awarnings") .arg("check") .arg("--jobs") .arg("1") .arg("-p") - .arg("application") + .arg(format!("application_{}", test.name_hash)) .arg("--quiet") - .current_dir(&test.test_runtime_directory()) + .current_dir(&test.runtime_directory) .output() .unwrap(); let compilation_output: Result = (&output).try_into(); @@ -669,15 +851,15 @@ fn _run_test( } // Run integration tests, if we have any, - if let ShouldRunTests::Yes = should_run_tests { + if let ShouldRunTests::Yes = test.should_run_tests() { let output = std::process::Command::new("cargo") - .env("RUSTFLAGS", "-Awarnings") + // .env("RUSTFLAGS", "-Awarnings") .arg("t") .arg("--jobs") .arg("1") .arg("-p") - .arg("integration") - .current_dir(&test.test_runtime_directory()) + .arg(format!("integration_{}", test.name_hash)) + .current_dir(&test.runtime_directory) .output() .unwrap(); let test_output: CommandOutput = (&output).try_into()?; diff --git a/libs/pavex_test_runner/src/snapshot.rs b/libs/pavex_test_runner/src/snapshot.rs index 7850fc9a1..b2868916b 100644 --- a/libs/pavex_test_runner/src/snapshot.rs +++ b/libs/pavex_test_runner/src/snapshot.rs @@ -12,14 +12,22 @@ fn term_width() -> usize { pub(crate) struct SnapshotTest { expectation_path: PathBuf, + app_name_with_hash: String, } impl SnapshotTest { - pub fn new(expectation_path: PathBuf) -> Self { - Self { expectation_path } + pub fn new(expectation_path: PathBuf, app_name_with_hash: String) -> Self { + Self { + expectation_path, + app_name_with_hash, + } } pub fn verify(&self, actual: &str) -> Result<(), ()> { + // All test crates have a hash suffix in their name to avoid name collisions. + // We remove this hash to make the snapshots more stable and readable. + let actual = actual.replace(&self.app_name_with_hash, "app"); + let expected = match fs_err::read_to_string(&self.expectation_path) { Ok(s) => s, Err(e) if e.kind() == ErrorKind::NotFound => "".into(), diff --git a/libs/pavex_test_runner2/Cargo.toml b/libs/pavex_test_runner2/Cargo.toml deleted file mode 100644 index f4d74a4f2..000000000 --- a/libs/pavex_test_runner2/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "pavex_test_runner2" -version.workspace = true -description = "A custom test runner to execute UI tests for Pavex" -keywords = ["pavex"] -edition.workspace = true -repository.workspace = true -license.workspace = true -publish = false - -[package.metadata.dist] -dist = false - -[dependencies] -anyhow = { workspace = true } -ahash = { workspace = true } -console = { workspace = true } -fs-err = { workspace = true } -libtest-mimic = { workspace = true } -serde = { workspace = true, features = ["derive"] } -similar = { workspace = true, features = ["inline"] } -textwrap = { workspace = true } -toml = { workspace = true, features = ["preserve_order"] } -miette = { workspace = true, features = ["fancy"] } -walkdir = { workspace = true } -serde_json = { workspace = true } -itertools = { workspace = true } -sha2 = { workspace = true } -persist_if_changed = { path = "../persist_if_changed", version = "0.1.48" } -object-pool = { workspace = true } -num_cpus = { workspace = true } -globwalk = { workspace = true } -tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] } -regex = { workspace = true } -once_cell = { workspace = true } -px_workspace_hack = { version = "0.1", path = "../px_workspace_hack" } -pavexc = { path = "../pavexc" } -guppy = { workspace = true } diff --git a/libs/pavex_test_runner2/src/lib.rs b/libs/pavex_test_runner2/src/lib.rs deleted file mode 100644 index 8ee379dfa..000000000 --- a/libs/pavex_test_runner2/src/lib.rs +++ /dev/null @@ -1,901 +0,0 @@ -use std::collections::BTreeMap; -use std::fmt::Write; -use std::path::{Component, Path, PathBuf}; -use std::process::{Command, Output}; - -use ahash::{HashMap, HashSet}; -use anyhow::Context; -use console::style; -use guppy::PackageId; -use itertools::Itertools; -use libtest_mimic::{Conclusion, Failed}; -use pavexc::rustdoc::CrateCollection; -use pavexc::DEFAULT_DOCS_TOOLCHAIN; -use sha2::Digest; -use toml::toml; -use walkdir::WalkDir; - -use persist_if_changed::{copy_if_changed, persist_if_changed}; -pub use snapshot::print_changeset; - -use crate::snapshot::SnapshotTest; - -mod snapshot; -mod target_directory; - -/// Return an iterator over the directories containing a UI test. -pub fn get_ui_test_directories(test_folder: &Path) -> impl Iterator { - WalkDir::new(test_folder) - .into_iter() - .filter_map(|entry| entry.ok()) - .filter(|entry| entry.file_name() == "test_config.toml") - .map(|entry| entry.path().parent().unwrap().to_path_buf()) -} - -/// Create a test case for each folder in `definition_directory`. -/// -/// Each test will get a separate runtime environmentβ€”a sub-folder of `runtime_directory`. The -/// same sub-folder is reused across multiple test runs to benefit from cargo's incremental compilation. -/// -/// Custom configuration can be specified on a per-test basis by including a `test_config.toml` file -/// in the test folder. The available test options are detailed in `TestConfig`. -/// -/// # cargo-nextest -/// -/// Our custom test runner is built on top of `libtest_mimic`, which gives us -/// [compatibility out-of-the-box](https://nexte.st/book/custom-test-harnesses.html) with `cargo-nextest`. -pub fn run_tests( - pavex_cli: PathBuf, - pavexc_cli: PathBuf, - definition_directory: PathBuf, - runtime_directory: PathBuf, -) -> Result { - let arguments = libtest_mimic::Arguments::from_args(); - - let mut test_name2test_data = BTreeMap::new(); - for entry in get_ui_test_directories(&definition_directory) { - let relative_path = entry.strip_prefix(&definition_directory).unwrap(); - let test_name = relative_path - .components() - .map(|c| { - let Component::Normal(c) = c else { - panic!("Expected a normal component") - }; - c.to_string_lossy() - }) - .join("::"); - let test_data = TestData::new( - &test_name, - entry.clone(), - runtime_directory.join(relative_path), - )?; - test_name2test_data.insert(test_name, test_data); - } - - create_tests_dir(&runtime_directory, &test_name2test_data, &pavex_cli)?; - - if !arguments.list { - warm_up_target_dir(&runtime_directory, &test_name2test_data)?; - } - - let mut tests = Vec::new(); - for (name, data) in test_name2test_data { - let pavexc_cli = pavexc_cli.clone(); - let runtime_directory = runtime_directory.clone(); - let ignored = data.configuration.ignore; - let test = - libtest_mimic::Trial::test(name, move || run_test(runtime_directory, data, pavexc_cli)) - .with_ignored_flag(ignored); - tests.push(test); - } - Ok(libtest_mimic::run(&arguments, tests)) -} - -/// Compile all binary targets of the type `app_*`. -/// This ensures that all dependencies have been compiled, speeding up further operations, -/// as well as preparing the binaries that each test will invoke. -fn warm_up_target_dir( - runtime_directory: &Path, - test_name2test_data: &BTreeMap, -) -> Result<(), anyhow::Error> { - println!("Creating a workspace-hack crate to unify dependencies"); - - // Clean up pre-existing workspace_hack, since `cargo hakari init` will fail - // if it already exists. - // let _ = fs_err::remove_dir_all(runtime_directory.join("workspace_hack")); - // let _ = fs_err::remove_file(runtime_directory.join(".config").join("hakari.toml")); - - // let mut cmd = Command::new("cargo"); - // cmd.arg("hakari") - // .arg("init") - // .arg("-y") - // .arg("workspace_hack") - // .current_dir(runtime_directory) - // .stdout(std::process::Stdio::inherit()) - // .stderr(std::process::Stdio::inherit()); - // let status = cmd.status()?; - // if !status.success() { - // anyhow::bail!("Failed to create workspace_hack crate"); - // } - - let mut cmd = Command::new("cargo"); - cmd.arg("hakari") - .arg("generate") - .current_dir(runtime_directory) - .stdout(std::process::Stdio::inherit()) - .stderr(std::process::Stdio::inherit()); - let status = cmd.status()?; - if !status.success() { - anyhow::bail!("Failed to generate workspace_hack crate"); - } - - // let mut cmd = Command::new("cargo"); - // cmd.arg("hakari") - // .arg("manage-deps") - // .arg("-y") - // .current_dir(runtime_directory) - // .stdout(std::process::Stdio::inherit()) - // .stderr(std::process::Stdio::inherit()); - // let status = cmd.status()?; - // if !status.success() { - // anyhow::bail!("Failed to manage workspace_hack dependencies"); - // } - - let timer = std::time::Instant::now(); - println!("Warming up the target directory"); - let mut cmd = Command::new("cargo"); - cmd.arg("build") - .arg("--bins") - .stdout(std::process::Stdio::inherit()) - .stderr(std::process::Stdio::inherit()) - .current_dir(runtime_directory); - let status = cmd.status()?; - if !status.success() { - anyhow::bail!("Failed to compile the test binaries"); - } - println!( - "Warmed up the target directory in {} seconds", - timer.elapsed().as_secs() - ); - - let timer = std::time::Instant::now(); - println!("Pre-computing JSON documentation for relevant crates"); - let crate_collection = CrateCollection::new( - runtime_directory.to_string_lossy().into_owned(), - DEFAULT_DOCS_TOOLCHAIN.to_owned(), - runtime_directory.to_path_buf(), - )?; - let mut crates = test_name2test_data - .values() - .map(|data| format!("app_{}", data.name_hash)) - .collect::>(); - crates.insert("pavex".into()); - crates.insert("tracing".into()); - crates.insert("equivalent".into()); - crates.insert("ppv-lite86".into()); - crates.insert("hashbrown".into()); - crates.insert("typenum".into()); - let package_ids = crate_collection - .package_graph() - .packages() - .filter(|p| crates.contains(p.name())) - .map(|p| p.id().to_owned()); - crate_collection - .batch_compute_crates(package_ids) - .context("Failed to warm rustdoc JSON cache")?; - println!( - "Pre-computed JSON documentation in {} seconds", - timer.elapsed().as_secs() - ); - - Ok(()) -} - -fn create_tests_dir( - runtime_directory: &Path, - test_name2test_data: &BTreeMap, - pavex_cli: &Path, -) -> Result<(), anyhow::Error> { - let timer = std::time::Instant::now(); - println!("Seeding the filesystem"); - fs_err::create_dir_all(&runtime_directory) - .context("Failed to create runtime directory for UI tests")?; - - // Create a `Cargo.toml` to define a workspace, - // where each UI test is a workspace member - let cargo_toml_path = runtime_directory.join("Cargo.toml"); - let mut cargo_toml = String::new(); - writeln!(&mut cargo_toml, "[workspace]\nmembers = [").unwrap(); - for test_data in test_name2test_data.values() { - for member in test_data.workspace_members() { - let relative_path = member.strip_prefix(&runtime_directory).unwrap(); - writeln!(cargo_toml, " \"{}\",", relative_path.display()).unwrap(); - } - } - writeln!(&mut cargo_toml, "]").unwrap(); - writeln!(&mut cargo_toml, "resolver = \"2\"").unwrap(); - writeln!(&mut cargo_toml, "[workspace.dependencies]").unwrap(); - writeln!(&mut cargo_toml, "pavex = {{ path = \"../pavex\" }}").unwrap(); - writeln!( - &mut cargo_toml, - "pavex_cli_client = {{ path = \"../pavex_cli_client\" }}" - ) - .unwrap(); - writeln!( - &mut cargo_toml, - "workspace_hack = {{ path = \"workspace_hack\" }}" - ) - .unwrap(); - writeln!(&mut cargo_toml, "tokio = \"1\"").unwrap(); - writeln!(&mut cargo_toml, "reqwest = \"0.12\"").unwrap(); - - persist_if_changed(&cargo_toml_path, cargo_toml.as_bytes())?; - - // Create a manifest for each UI test - // Each UI test is composed of multiple crates, therefore we nest - // everything under a test-specific directory to avoid name - // clashes and confusion across tests - for test_data in test_name2test_data.values() { - test_data.seed_test_filesystem(pavex_cli)?; - } - - println!( - "Seeded the filesystem in {:?}ms", - timer.elapsed().as_millis() - ); - - Ok(()) -} - -#[derive(serde::Deserialize)] -#[serde(rename_all = "snake_case")] -/// Configuration values that can be specified next to the test data to influence how it's going -/// to be executed. -struct TestConfig { - /// A short description explaining what the test is about, primarily for documentation purposes. - /// It will be shown in the terminal if the test fails. - description: String, - /// Define what we expect to see when running the tests (e.g. should code generation succeed or fail?). - #[serde(default)] - expectations: TestExpectations, - /// Ephemeral crates that should be generated as part of the test setup in order to be - /// used as dependencies of the main crate under test. - #[serde(default)] - ephemeral_dependencies: HashMap, - /// Crates that should be listed as dependencies of the package under the test, in addition to - /// Pavex itself. - #[serde(default)] - dependencies: toml::value::Table, - /// Crates that should be listed as dev dependencies of the test package. - #[serde(default, rename = "dev-dependencies")] - dev_dependencies: toml::value::Table, - /// Ignore the test if set to `true`. - #[serde(default)] - ignore: bool, -} - -#[derive(serde::Deserialize)] -#[serde(rename_all = "snake_case")] -struct EphemeralDependency { - #[serde(default)] - /// The name of the package in the generated `Cargo.toml`. - /// If not specified, the corresponding key in [`TestConfig::ephemeral_dependencies`] will be used. - package: Option, - /// The path to the file that should be used as `lib.rs` in the generated library crate. - path: PathBuf, - /// Crates that should be listed as dependencies of generated library crate. - #[serde(default)] - dependencies: toml::value::Table, - #[serde(default = "default_ephemeral_version")] - /// The version of the package in the generated `Cargo.toml`. - /// If not specified, it defaults to `0.1.0`. - version: String, -} - -fn default_ephemeral_version() -> String { - "0.1.0".to_string() -} - -#[derive(serde::Deserialize)] -#[serde(rename_all = "snake_case")] -struct TestExpectations { - /// By default, we expect code generation (i.e. `app.build()`) to succeed. - /// If set to `fail`, the test runner will look for a snapshot of the expected failure message - /// returned by Pavex to the user. - #[serde(default = "ExpectedOutcome::pass")] - codegen: ExpectedOutcome, - #[serde(default = "ExpectedOutcome::pass")] - lints: ExpectedOutcome, -} - -impl Default for TestExpectations { - fn default() -> Self { - Self { - codegen: ExpectedOutcome::Pass, - lints: ExpectedOutcome::Pass, - } - } -} - -#[derive(serde::Deserialize, PartialEq, Eq)] -#[serde(rename_all = "snake_case")] -enum ExpectedOutcome { - Pass, - Fail, -} - -impl ExpectedOutcome { - fn pass() -> ExpectedOutcome { - ExpectedOutcome::Pass - } -} - -/// Auxiliary data attached to each test definition for convenient retrieval. -/// It's used in [`run_test`]. -struct TestData { - name_hash: String, - definition_directory: PathBuf, - runtime_directory: PathBuf, - configuration: TestConfig, - has_tests: bool, -} - -impl TestData { - fn new( - test_name: &str, - definition_directory: PathBuf, - runtime_directory: PathBuf, - ) -> Result { - let name_hash = { - let mut hasher = sha2::Sha256::default(); - <_ as sha2::Digest>::update(&mut hasher, test_name.as_bytes()); - let full_hash = hasher.finalize(); - // Get the first 8 hex characters of the hash, they should be enough to identify the test - let mut hash = String::new(); - for byte in full_hash.iter().take(4) { - write!(&mut hash, "{:02x}", byte).unwrap(); - } - hash - }; - let configuration = Self::load_configuration(&definition_directory)?; - let integration_test_file = definition_directory.join("test.rs"); - let has_tests = integration_test_file.exists(); - Ok(Self { - name_hash, - definition_directory, - configuration, - runtime_directory, - has_tests, - }) - } - - fn workspace_members(&self) -> Vec { - let mut members = vec![ - self.blueprint_directory().to_path_buf(), - self.generated_app_directory(), - ]; - if let Some(dir) = self.integration_test_directory() { - members.push(dir.to_path_buf()); - } - members - } - - fn load_configuration(definition_directory: &Path) -> Result { - let path = definition_directory.join("test_config.toml"); - let test_config = fs_err::read_to_string(&path).context( - "All UI tests must have an associated `test_config.toml` file with, \ - at the very least, a `description` field explaining what the test is trying \ - to verify.", - )?; - toml::from_str(&test_config).with_context(|| { - format!( - "Failed to deserialize {:?}. Check the file against the expected schema!", - &path - ) - }) - } - - /// The directory containing the source code of all ephemeral dependencies. - /// - /// We don't want to list ephemeral dependencies as members of the workspace of the project under test - /// in order to be able to have multiple versions of the same crate as dependencies of the project under test. - /// That would be forbidden by `cargo` if they were listed as members of the same workspace. - fn ephemeral_deps_runtime_directory(&self) -> PathBuf { - self.runtime_directory.join("ephemeral_deps") - } - - fn blueprint_directory(&self) -> &Path { - &self.runtime_directory - } - - fn generated_app_directory(&self) -> PathBuf { - self.runtime_directory.join("generated_app") - } - - fn integration_test_directory(&self) -> Option { - self.has_tests - .then(|| self.runtime_directory.join("integration")) - } - - /// Populate the runtime test folder using the directives and the files in the test - /// definition folder. - fn seed_test_filesystem(&self, pavex_cli: &Path) -> Result<(), anyhow::Error> { - fs_err::create_dir_all(&self.runtime_directory) - .context("Failed to create runtime directory for UI test")?; - let source_directory = self.runtime_directory.join("src"); - fs_err::create_dir_all(&source_directory).context( - "Failed to create the runtime directory for the project under test when setting up the test runtime environment", - )?; - copy_if_changed( - &self.definition_directory.join("lib.rs"), - &source_directory.join("lib.rs"), - )?; - - let deps_subdir = self.ephemeral_deps_runtime_directory(); - fs_err::create_dir_all(&source_directory).context( - "Failed to create the runtime directory for ephemeral dependencies when setting up the test runtime environment", - )?; - - for (dependency_name, dependency_config) in &self.configuration.ephemeral_dependencies { - let dep_runtime_directory = deps_subdir.join(dependency_name); - let package_name = dependency_config - .package - .clone() - .unwrap_or(dependency_name.to_owned()); - let dep_source_directory = dep_runtime_directory.join("src"); - fs_err::create_dir_all(&dep_source_directory).context( - "Failed to create the source directory for an ephemeral dependency when setting up the test runtime environment", - )?; - - copy_if_changed( - &self.definition_directory.join(&dependency_config.path), - &dep_source_directory.join("lib.rs"), - )?; - - let mut cargo_toml = toml! { - [package] - name = "dummy" - version = "0.1.0" - edition = "2021" - - [lints.rust] - unexpected_cfgs = { level = "allow", check-cfg = ["cfg(pavex_ide_hint)"] } - - [dependencies] - pavex = { workspace = true } - }; - cargo_toml["package"]["name"] = format!("{package_name}_{}", self.name_hash).into(); - cargo_toml["package"]["version"] = dependency_config.version.clone().into(); - let deps = cargo_toml - .get_mut("dependencies") - .unwrap() - .as_table_mut() - .unwrap(); - deps.extend(dependency_config.dependencies.clone()); - - persist_if_changed( - &dep_runtime_directory.join("Cargo.toml"), - toml::to_string(&cargo_toml)?.as_bytes(), - )?; - } - - if let Some(integration_test_directory) = self.integration_test_directory() { - let integration_test_file = self.definition_directory.join("test.rs"); - let integration_test_src_directory = integration_test_directory.join("src"); - let integration_test_test_directory = integration_test_directory.join("tests"); - fs_err::create_dir_all(&integration_test_src_directory).context( - "Failed to create the runtime directory for integration tests when setting up the test runtime environment", - )?; - fs_err::create_dir_all(&integration_test_test_directory).context( - "Failed to create the runtime directory for integration tests when setting up the test runtime environment", - )?; - copy_if_changed( - &integration_test_file, - &integration_test_test_directory.join("run.rs"), - )?; - persist_if_changed(&integration_test_src_directory.join("lib.rs"), b"")?; - - let mut cargo_toml = toml! { - [package] - name = "dummy" - version = "0.1.0" - edition = "2021" - - [dependencies] - application = { path = "../generated_app" } - app = { path = ".." } - - [dev-dependencies] - tokio = { workspace = true, features = ["full"] } - reqwest = { workspace = true } - pavex = { workspace = true } - }; - cargo_toml["package"]["name"] = format!("integration_{}", self.name_hash).into(); - cargo_toml["dependencies"]["application"] - .as_table_mut() - .unwrap() - .insert( - "package".into(), - format!("application_{}", self.name_hash).into(), - ); - cargo_toml["dependencies"]["app"] - .as_table_mut() - .unwrap() - .insert("package".into(), format!("app_{}", self.name_hash).into()); - - let dev_deps = cargo_toml - .get_mut("dev-dependencies") - .unwrap() - .as_table_mut() - .unwrap(); - dev_deps.extend(self.configuration.dev_dependencies.clone()); - - persist_if_changed( - &integration_test_directory.join("Cargo.toml"), - toml::to_string(&cargo_toml)?.as_bytes(), - )?; - } - - // Generated application crate, ahead of code generation. - { - let application_dir = self.generated_app_directory(); - let application_src_dir = application_dir.join("src"); - fs_err::create_dir_all(&application_src_dir).context( - "Failed to create the runtime directory for the generated application when setting up the test runtime environment", - )?; - persist_if_changed(&application_src_dir.join("lib.rs"), b"")?; - - let mut cargo_toml = toml! { - [package] - name = "dummy" - version = "0.1.0" - edition = "2021" - - [package.metadata.px.generate] - generator_type = "cargo_workspace_binary" - generator_name = "app" - }; - cargo_toml["package"]["name"] = format!("application_{}", self.name_hash).into(); - persist_if_changed( - &application_dir.join("Cargo.toml"), - toml::to_string(&cargo_toml)?.as_bytes(), - )?; - } - - let mut cargo_toml = toml! { - [package] - name = "dummy" - version = "0.1.0" - edition = "2021" - - [lints.rust] - unexpected_cfgs = { level = "allow", check-cfg = ["cfg(pavex_ide_hint)"] } - - [dependencies] - pavex = { workspace = true } - pavex_cli_client = { workspace = true } - workspace_hack = { workspace = true } - }; - cargo_toml["package"]["name"] = format!("app_{}", self.name_hash).into(); - let deps = cargo_toml - .get_mut("dependencies") - .unwrap() - .as_table_mut() - .unwrap(); - deps.extend(self.configuration.dependencies.clone()); - let ephemeral_dependencies = - self.configuration - .ephemeral_dependencies - .iter() - .map(|(key, config)| { - let mut value = toml::value::Table::new(); - value.insert("path".into(), format!("ephemeral_deps/{key}").into()); - let package_name = if let Some(package_name) = config.package.as_ref() { - package_name.to_owned() - } else { - key.to_owned() - }; - value.insert( - "package".into(), - format!("{package_name}_{}", self.name_hash).into(), - ); - (key.to_owned(), toml::Value::Table(value)) - }); - deps.extend(ephemeral_dependencies); - - persist_if_changed( - &self.runtime_directory.join("Cargo.toml"), - toml::to_string(&cargo_toml)?.as_bytes(), - )?; - - let main_rs = format!( - r##"use app_{}::blueprint; -use pavex_cli_client::{{Client, config::Color}}; -use pavex_cli_client::commands::generate::GenerateError; - -fn main() -> Result<(), Box> {{ - let outcome = Client::new() - .color(Color::Always) - .pavex_cli_path(r#"{}"#.into()) - .generate(blueprint(), "generated_app".into()) - .diagnostics_path("diagnostics.dot".into()) - .execute(); - match outcome {{ - Ok(_) => {{}}, - Err(GenerateError::NonZeroExitCode(_)) => {{ std::process::exit(1); }} - Err(e) => {{ - eprintln!("Failed to invoke `pavex generate`.\n{{:?}}", e); - std::process::exit(1); - }} - }} - Ok(()) -}} -"##, - self.name_hash, - pavex_cli.to_str().unwrap() - ); - persist_if_changed(&source_directory.join("main.rs"), main_rs.as_bytes())?; - Ok(()) - } - - pub fn should_run_tests(&self) -> ShouldRunTests { - if self.has_tests { - ShouldRunTests::Yes - } else { - ShouldRunTests::No - } - } -} - -enum ShouldRunTests { - Yes, - No, -} - -fn run_test(runtime_directory: PathBuf, test: TestData, pavexc_cli: PathBuf) -> Result<(), Failed> { - match _run_test(&runtime_directory, &test, &pavexc_cli) { - Ok(TestOutcome { - outcome: Err(mut msg), - codegen_output, - compilation_output, - test_output, - }) => Err(Failed::from({ - write!( - &mut msg, - "\n\nCODEGEN:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", - codegen_output.stdout, codegen_output.stderr - ) - .unwrap(); - if let Some(compilation_output) = compilation_output { - write!( - &mut msg, - "\n\nCARGO CHECK:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", - compilation_output.stdout, compilation_output.stderr - ) - .unwrap(); - } - if let Some(test_output) = test_output { - write!( - &mut msg, - "\n\nCARGO TEST:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", - test_output.stdout, test_output.stderr - ) - .unwrap(); - } - enrich_failure_message(&test.configuration, msg) - })), - Err(e) => Err(Failed::from(enrich_failure_message( - &test.configuration, - unexpected_failure_message(&e), - ))), - Ok(TestOutcome { - outcome: Ok(()), .. - }) => Ok(()), - } -} - -fn _run_test( - runtime_directory: &Path, - test: &TestData, - pavexc_cli: &Path, -) -> Result { - let binary_name = format!("app_{}", test.name_hash); - let timer = std::time::Instant::now(); - println!("Running {binary_name}"); - let binary = runtime_directory - .join("target") - .join("debug") - .join(&binary_name); - let output = std::process::Command::new(binary) - .env("PAVEX_PAVEXC", pavexc_cli) - .current_dir(&test.runtime_directory) - .output() - .context("Failed to perform code generation")?; - println!("Ran {binary_name} in {} seconds", timer.elapsed().as_secs()); - - let codegen_output: CommandOutput = (&output).try_into()?; - - let expectations_directory = test.definition_directory.join("expectations"); - - if !output.status.success() { - return match test.configuration.expectations.codegen { - ExpectedOutcome::Pass => Ok(TestOutcome { - outcome: Err("We failed to generate the application code.".to_string()), - codegen_output, - compilation_output: None, - test_output: None, - }), - ExpectedOutcome::Fail => { - let stderr_snapshot = SnapshotTest::new(expectations_directory.join("stderr.txt")); - if stderr_snapshot.verify(&codegen_output.stderr).is_err() { - return Ok(TestOutcome { - outcome: Err("The failure message returned by code generation doesn't match what we expected".into()), - codegen_output, - compilation_output: None, - test_output: None, - }); - } - Ok(TestOutcome { - outcome: Ok(()), - codegen_output, - compilation_output: None, - test_output: None, - }) - } - }; - } else if ExpectedOutcome::Fail == test.configuration.expectations.codegen { - return Ok(TestOutcome { - outcome: Err("We expected code generation to fail, but it succeeded!".into()), - codegen_output, - compilation_output: None, - test_output: None, - }); - }; - - if let ExpectedOutcome::Fail = test.configuration.expectations.lints { - let stderr_snapshot = SnapshotTest::new(expectations_directory.join("stderr.txt")); - if stderr_snapshot.verify(&codegen_output.stderr).is_err() { - return Ok(TestOutcome { - outcome: Err( - "The warnings returned by code generation don't match what we expected".into(), - ), - codegen_output, - compilation_output: None, - test_output: None, - }); - } - } - - let diagnostics_snapshot = SnapshotTest::new(expectations_directory.join("diagnostics.dot")); - let actual_diagnostics = - fs_err::read_to_string(test.runtime_directory.join("diagnostics.dot"))?; - // We don't exit early here to get the generated code snapshot as well. - // This allows to update both code snapshot and diagnostics snapshot in one go via - // `cargo r --bin snaps` for a failing test instead of having to do them one at a time, - // with a test run in the middle. - let diagnostics_outcome = diagnostics_snapshot.verify(&actual_diagnostics); - - let app_code_snapshot = SnapshotTest::new(expectations_directory.join("app.rs")); - let actual_app_code = - fs_err::read_to_string(test.generated_app_directory().join("src").join("lib.rs")).unwrap(); - let codegen_outcome = app_code_snapshot.verify(&actual_app_code); - - // Check that the generated code compiles - let output = std::process::Command::new("cargo") - // .env("RUSTFLAGS", "-Awarnings") - .arg("check") - .arg("--jobs") - .arg("1") - .arg("-p") - .arg(format!("application_{}", test.name_hash)) - .arg("--quiet") - .current_dir(&test.runtime_directory) - .output() - .unwrap(); - let compilation_output: Result = (&output).try_into(); - - if diagnostics_outcome.is_err() { - return Ok(TestOutcome { - outcome: Err( - "Diagnostics for the generated application don't match what we expected".into(), - ), - codegen_output, - compilation_output: None, - test_output: None, - }); - } - - if codegen_outcome.is_err() { - return Ok(TestOutcome { - outcome: Err("The generated application code doesn't match what we expected".into()), - codegen_output, - compilation_output: None, - test_output: None, - }); - } - - let compilation_output = compilation_output?; - if !output.status.success() { - return Ok(TestOutcome { - outcome: Err("The generated application code doesn't compile.".into()), - codegen_output, - compilation_output: Some(compilation_output), - test_output: None, - }); - } - - // Run integration tests, if we have any, - if let ShouldRunTests::Yes = test.should_run_tests() { - let output = std::process::Command::new("cargo") - // .env("RUSTFLAGS", "-Awarnings") - .arg("t") - .arg("--jobs") - .arg("1") - .arg("-p") - .arg(format!("integration_{}", test.name_hash)) - .current_dir(&test.runtime_directory) - .output() - .unwrap(); - let test_output: CommandOutput = (&output).try_into()?; - if !output.status.success() { - return Ok(TestOutcome { - outcome: Err("Integration tests failed.".into()), - codegen_output, - test_output: Some(test_output), - compilation_output: Some(compilation_output), - }); - } - } - - Ok(TestOutcome { - outcome: Ok(()), - codegen_output, - compilation_output: Some(compilation_output), - test_output: None, - }) -} - -struct TestOutcome { - outcome: Result<(), String>, - codegen_output: CommandOutput, - compilation_output: Option, - test_output: Option, -} - -/// A refined `std::process::Output` that assumes that both stderr and stdout are valid UTF8. -struct CommandOutput { - stdout: String, - stderr: String, -} - -impl TryFrom<&Output> for CommandOutput { - type Error = anyhow::Error; - - fn try_from(o: &Output) -> Result { - let stdout = std::str::from_utf8(&o.stdout) - .context("The application printed invalid UTF8 data to stdout")?; - let stderr = std::str::from_utf8(&o.stderr) - .context("The application printed invalid UTF8 data to stderr")?; - Ok(Self { - stdout: stdout.to_string(), - stderr: stderr.to_string(), - }) - } -} - -fn unexpected_failure_message(e: &anyhow::Error) -> String { - format!( - "An unexpected error was encountered when running a test.\n\n{}\n---\n{:?}", - &e, &e - ) -} - -fn enrich_failure_message(config: &TestConfig, error: impl AsRef) -> String { - let description = style(textwrap::indent(&config.description, " ")).cyan(); - let error = style(textwrap::indent(error.as_ref(), " ")).red(); - format!( - "{}\n{description}.\n{}\n{error}", - style("What is the test about:").cyan().dim().bold(), - style("What went wrong:").red().bold(), - ) -} diff --git a/libs/pavex_test_runner2/src/snapshot.rs b/libs/pavex_test_runner2/src/snapshot.rs deleted file mode 100644 index 7850fc9a1..000000000 --- a/libs/pavex_test_runner2/src/snapshot.rs +++ /dev/null @@ -1,151 +0,0 @@ -use std::io::ErrorKind; -use std::path::PathBuf; -use std::time::Duration; - -use console::style; -use regex::Captures; -use similar::{Algorithm, ChangeTag, TextDiff}; - -fn term_width() -> usize { - console::Term::stdout().size().1 as usize -} - -pub(crate) struct SnapshotTest { - expectation_path: PathBuf, -} - -impl SnapshotTest { - pub fn new(expectation_path: PathBuf) -> Self { - Self { expectation_path } - } - - pub fn verify(&self, actual: &str) -> Result<(), ()> { - let expected = match fs_err::read_to_string(&self.expectation_path) { - Ok(s) => s, - Err(e) if e.kind() == ErrorKind::NotFound => "".into(), - outcome @ Err(_) => { - outcome.expect("Failed to load the expected value for a snapshot test") - } - }; - let trimmed_expected = expected.trim(); - let actual = actual.trim(); - - // Replace all line endings with `\n` to make sure that the snapshots are cross-platform. - let trimmed_expected = trimmed_expected.replace("\r\n", "\n"); - let actual = actual.replace("\r\n", "\n"); - - // Path normalization for Windows, which uses `\` instead of `/` as path separator. - static RE: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| { - regex::Regex::new(r#"(?\[\[36;1;4m)(?.*)"#).unwrap() - }); - let normalizer = |c: &Captures| { - let prefix = c.name("prefix").unwrap().as_str(); - let path = c.name("path").unwrap().as_str().replace("\\", "/"); - format!("{prefix}{path}",) - }; - let trimmed_expected = RE.replace_all(&trimmed_expected, normalizer); - let actual = RE.replace_all(&actual, normalizer); - - let expectation_directory = self.expectation_path.parent().unwrap(); - let last_snapshot_path = expectation_directory.join(format!( - "{}.snap", - self.expectation_path.file_name().unwrap().to_string_lossy() - )); - - if trimmed_expected != actual { - print_changeset(&trimmed_expected, &actual); - fs_err::write(last_snapshot_path, actual.as_ref()) - .expect("Failed to save the actual value for a failed snapshot test"); - Err(()) - } else { - let _ = fs_err::remove_file(last_snapshot_path); - Ok(()) - } - } -} - -pub fn print_changeset(old: &str, new: &str) { - let width = term_width(); - let diff = TextDiff::configure() - .algorithm(Algorithm::Patience) - .timeout(Duration::from_millis(500)) - .diff_lines(old, new); - println!("{:─^1$}", "", width); - - if !old.is_empty() { - println!("{}", style("-old snapshot").red()); - println!("{}", style("+new results").green()); - } else { - println!("{}", style("+new results").green()); - } - - println!("────────────┬{:─^1$}", "", width.saturating_sub(13)); - let mut has_changes = false; - for (idx, group) in diff.grouped_ops(4).iter().enumerate() { - if idx > 0 { - println!("β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Ό{:β”ˆ^1$}", "", width.saturating_sub(13)); - } - for op in group { - for change in diff.iter_inline_changes(op) { - match change.tag() { - ChangeTag::Insert => { - has_changes = true; - print!( - "{:>5} {:>5} β”‚{}", - "", - style(change.new_index().unwrap()).cyan().dim().bold(), - style("+").green(), - ); - for &(emphasized, change) in change.values() { - if emphasized { - print!("{}", style(change).green().underlined()); - } else { - print!("{}", style(change).green()); - } - } - } - ChangeTag::Delete => { - has_changes = true; - print!( - "{:>5} {:>5} β”‚{}", - style(change.old_index().unwrap()).cyan().dim(), - "", - style("-").red(), - ); - for &(emphasized, change) in change.values() { - if emphasized { - print!("{}", style(change).red().underlined()); - } else { - print!("{}", style(change).red()); - } - } - } - ChangeTag::Equal => { - print!( - "{:>5} {:>5} β”‚ ", - style(change.old_index().unwrap()).cyan().dim(), - style(change.new_index().unwrap()).cyan().dim().bold(), - ); - for &(_, change) in change.values() { - print!("{}", style(change).dim()); - } - } - } - if change.missing_newline() { - println!(); - } - } - } - } - - if !has_changes { - println!( - "{:>5} {:>5} β”‚{}", - "", - style("-").dim(), - style(" snapshots are matching").cyan(), - ); - } - - println!("────────────┴{:─^1$}", "", width.saturating_sub(13),); -} diff --git a/libs/pavex_test_runner2/src/target_directory.rs b/libs/pavex_test_runner2/src/target_directory.rs deleted file mode 100644 index 4e87b98ab..000000000 --- a/libs/pavex_test_runner2/src/target_directory.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! Assigning a distinct target directory to each test case doesn't scale. -//! Those directories are big and can easily fill up your disk (and they -//! have started to do so once the number of tests grew to 50+). -//! -//! This module provides functionality to re-use target directories across -//! different test cases. -//! We create N target directories, where N is the number of cores on the -//! machine. Each test case is assigned a target directory from this pool -//! once it kicks off. -//! Since the test runner doesn't execute more than N test cases in -//! parallel, this approach guarantees that test cases don't have to wait -//! to be assigned a target directory (i.e. we still get maximum parallelism). -//! -//! We can't reuse the same target directory for all tests since each test -//! needs to acquire a unique lock on the target directory in order to -//! execute `cargo` commands. Having a single target directory would -//! serialize all tests, which would be a huge performance hit. - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use object_pool::Reusable; - -#[derive(Clone)] -pub struct TargetDirectoryPool { - directories: Arc>, -} - -impl TargetDirectoryPool { - pub fn new(size: Option, test_env_dir: &Path) -> Self { - let size = size.unwrap_or_else(num_cpus::get); - // The function signature here is awkward because it doesn't allow us to - // borrow from the environment in the closure, which in turns means we can't guarantee deterministic names for the target directories. - // We work around the issue by attaching objects to the pool manually - let directories = object_pool::Pool::new(0, || { - panic!("Target directories should never be initialized via the init closure") - }); - for i in 0..size { - directories.attach(create_target_directory(test_env_dir, i)); - } - Self { - directories: Arc::new(directories), - } - } - - /// Pull a target directory from the pool. - pub fn pull(&self) -> Reusable<'_, PathBuf> { - self.directories - .try_pull() - .expect("Failed to pull a target directory from the pool") - } -} - -fn create_target_directory(test_env_dir: &Path, i: usize) -> PathBuf { - let target_dir_path = test_env_dir - .join("target_dirs") - .join(format!("target_{:0>2}", i)); - fs_err::create_dir_all(&target_dir_path).expect("Failed to create target directory"); - target_dir_path -} From cc3cd00621027e266ae4f8e69de9edf8d567e17e Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:10:53 +0200 Subject: [PATCH 05/16] Refactor towards more granular test reporting --- libs/pavex_test_runner/src/lib.rs | 542 ++++++++++-------- .../pavex_test_runner/src/target_directory.rs | 62 -- 2 files changed, 310 insertions(+), 294 deletions(-) delete mode 100644 libs/pavex_test_runner/src/target_directory.rs diff --git a/libs/pavex_test_runner/src/lib.rs b/libs/pavex_test_runner/src/lib.rs index 448a37d6e..49da8e546 100644 --- a/libs/pavex_test_runner/src/lib.rs +++ b/libs/pavex_test_runner/src/lib.rs @@ -1,4 +1,3 @@ -#![allow(dead_code)] use std::collections::BTreeMap; use std::fmt::Write; use std::path::{Component, Path, PathBuf}; @@ -8,7 +7,7 @@ use ahash::{HashMap, HashSet}; use anyhow::Context; use console::style; use itertools::Itertools; -use libtest_mimic::{Conclusion, Failed}; +use libtest_mimic::{Arguments, Conclusion, Failed, Trial}; use pavexc::rustdoc::CrateCollection; use pavexc::DEFAULT_DOCS_TOOLCHAIN; use sha2::Digest; @@ -21,7 +20,6 @@ pub use snapshot::print_changeset; use crate::snapshot::SnapshotTest; mod snapshot; -mod target_directory; /// Return an iterator over the directories containing a UI test. pub fn get_ui_test_directories(test_folder: &Path) -> impl Iterator { @@ -74,35 +72,111 @@ pub fn run_tests( entry.clone(), runtime_directory.join(relative_path), )?; + if is_filtered_out(&arguments, &test_name) || test_data.configuration.ignore { + continue; + } test_name2test_data.insert(test_name, test_data); } create_tests_dir(&runtime_directory, &test_name2test_data, &pavex_cli)?; + let mut trials = Vec::new(); if !arguments.list { - warm_up_target_dir(&runtime_directory, &test_name2test_data)?; + warm_up_target_dir(&runtime_directory)?; + warm_up_rustdoc_cache(&runtime_directory, &test_name2test_data)?; + + // TODO: We need to run them in parallel. + for (name, data) in test_name2test_data { + let (codegen_output, outcome) = + code_generation_test(&runtime_directory, &data, &pavexc_cli); + let is_success = outcome == CodegenTestOutcome::Success; + let trial = outcome.into_trial(&name, &data.configuration, codegen_output.as_ref()); + trials.push(trial); + + // If the code generation test failed, we skip the follow-up tests. + if !is_success { + continue; + } + + if let Some(codegen_output) = codegen_output { + if let Some(trial) = code_generation_lints_test(&data, &name, &codegen_output) { + trials.push(trial); + } + }; + + if data.configuration.expectations.codegen == ExpectedOutcome::Fail { + continue; + } + + let trial = code_generation_diagnostics_test(&name, &data); + trials.push(trial); + + let trial = application_code_test(&name, &data); + trials.push(trial); + + let trial_name = format!("{}::app_code_compiles", name); + match application_code_compilation_test(&data) { + Ok(_) => { + let trial = Trial::test(trial_name, || Ok(())); + trials.push(trial); + } + Err(err) => { + let msg = format!("{err:?}"); + let trial = Trial::test(trial_name, move || Err(Failed::from(msg))); + trials.push(trial); + + // We skip the follow-up tests if the application code compilation test failed. + continue; + } + } + + if data.should_run_tests() { + let trial_name = format!("{}::app_integration_tests", name); + match application_integration_test(&data) { + Ok(_) => { + let trial = Trial::test(trial_name, || Ok(())); + trials.push(trial); + } + Err(err) => { + let msg = format!("{err:?}"); + let trial = Trial::test(trial_name, move || Err(Failed::from(msg))); + trials.push(trial); + } + } + } + } + } + Ok(libtest_mimic::run(&arguments, trials)) +} + +// Inlined from `libtest_mimic` to further control the test execution. +// We ignore test kind since we don't have benches in our UI test suite. +fn is_filtered_out(args: &Arguments, test_name: &str) -> bool { + // If a filter was specified, apply this + if let Some(filter) = &args.filter { + match args.exact { + true if test_name != filter => return true, + false if !test_name.contains(filter) => return true, + _ => {} + }; } - let mut tests = Vec::new(); - for (name, data) in test_name2test_data { - let pavexc_cli = pavexc_cli.clone(); - let runtime_directory = runtime_directory.clone(); - let ignored = data.configuration.ignore; - let test = - libtest_mimic::Trial::test(name, move || run_test(runtime_directory, data, pavexc_cli)) - .with_ignored_flag(ignored); - tests.push(test); + // If any skip pattern were specified, test for all patterns. + for skip_filter in &args.skip { + match args.exact { + true if test_name == skip_filter => return true, + false if test_name.contains(skip_filter) => return true, + _ => {} + } } - Ok(libtest_mimic::run(&arguments, tests)) + + false } /// Compile all binary targets of the type `app_*`. /// This ensures that all dependencies have been compiled, speeding up further operations, /// as well as preparing the binaries that each test will invoke. -fn warm_up_target_dir( - runtime_directory: &Path, - test_name2test_data: &BTreeMap, -) -> Result<(), anyhow::Error> { +fn warm_up_target_dir(runtime_directory: &Path) -> Result<(), anyhow::Error> { println!("Creating a workspace-hack crate to unify dependencies"); // Clean up pre-existing workspace_hack, since `cargo hakari init` will fail @@ -110,41 +184,41 @@ fn warm_up_target_dir( // let _ = fs_err::remove_dir_all(runtime_directory.join("workspace_hack")); // let _ = fs_err::remove_file(runtime_directory.join(".config").join("hakari.toml")); - let mut cmd = Command::new("cargo"); - cmd.arg("hakari") - .arg("init") - .arg("-y") - .arg("workspace_hack") - .current_dir(runtime_directory) - .stdout(std::process::Stdio::inherit()) - .stderr(std::process::Stdio::inherit()); - let status = cmd.status()?; - if !status.success() { - anyhow::bail!("Failed to create workspace_hack crate"); - } - - let mut cmd = Command::new("cargo"); - cmd.arg("hakari") - .arg("generate") - .current_dir(runtime_directory) - .stdout(std::process::Stdio::inherit()) - .stderr(std::process::Stdio::inherit()); - let status = cmd.status()?; - if !status.success() { - anyhow::bail!("Failed to generate workspace_hack crate"); - } - - let mut cmd = Command::new("cargo"); - cmd.arg("hakari") - .arg("manage-deps") - .arg("-y") - .current_dir(runtime_directory) - .stdout(std::process::Stdio::inherit()) - .stderr(std::process::Stdio::inherit()); - let status = cmd.status()?; - if !status.success() { - anyhow::bail!("Failed to manage workspace_hack dependencies"); - } + // let mut cmd = Command::new("cargo"); + // cmd.arg("hakari") + // .arg("init") + // .arg("-y") + // .arg("workspace_hack") + // .current_dir(runtime_directory) + // .stdout(std::process::Stdio::inherit()) + // .stderr(std::process::Stdio::inherit()); + // let status = cmd.status()?; + // if !status.success() { + // anyhow::bail!("Failed to create workspace_hack crate"); + // } + + // let mut cmd = Command::new("cargo"); + // cmd.arg("hakari") + // .arg("generate") + // .current_dir(runtime_directory) + // .stdout(std::process::Stdio::inherit()) + // .stderr(std::process::Stdio::inherit()); + // let status = cmd.status()?; + // if !status.success() { + // anyhow::bail!("Failed to generate workspace_hack crate"); + // } + + // let mut cmd = Command::new("cargo"); + // cmd.arg("hakari") + // .arg("manage-deps") + // .arg("-y") + // .current_dir(runtime_directory) + // .stdout(std::process::Stdio::inherit()) + // .stderr(std::process::Stdio::inherit()); + // let status = cmd.status()?; + // if !status.success() { + // anyhow::bail!("Failed to manage workspace_hack dependencies"); + // } let timer = std::time::Instant::now(); println!("Warming up the target directory"); @@ -163,6 +237,15 @@ fn warm_up_target_dir( timer.elapsed().as_secs() ); + Ok(()) +} + +/// Ensure all code generators won't have to invoke `rustdoc` to generate JSON documentation +/// by pre-computing the JSON documentation for all relevant crates. +fn warm_up_rustdoc_cache( + runtime_directory: &Path, + test_name2test_data: &BTreeMap, +) -> Result<(), anyhow::Error> { let timer = std::time::Instant::now(); // We want to ensure that all invocations of `pavexc generate` hit the cache // thus avoiding the need to invoke `rustdoc` and acquire a contentious @@ -176,6 +259,7 @@ fn warm_up_target_dir( let mut crates = test_name2test_data .values() .map(|data| format!("app_{}", data.name_hash)) + // TODO: we need to include locally-defined dependency crates as well .collect::>(); // Hand-picked crates that we know we're going to build docs for. crates.insert("pavex".into()); @@ -417,6 +501,10 @@ impl TestData { &self.runtime_directory } + fn expectations_directory(&self) -> PathBuf { + self.definition_directory.join("expectations") + } + fn generated_app_directory(&self) -> PathBuf { self.runtime_directory.join("generated_app") } @@ -674,160 +762,190 @@ fn main() -> Result<(), Box> {{ Ok(()) } - pub fn should_run_tests(&self) -> ShouldRunTests { - if self.has_tests { - ShouldRunTests::Yes - } else { - ShouldRunTests::No - } + pub fn should_run_tests(&self) -> bool { + self.has_tests } } -enum ShouldRunTests { - Yes, - No, +#[derive(Debug, PartialEq, Eq)] +enum CodegenTestOutcome { + Success, + Failure { msg: String }, } -fn run_test(runtime_directory: PathBuf, test: TestData, pavexc_cli: PathBuf) -> Result<(), Failed> { - match _run_test(&runtime_directory, &test, &pavexc_cli) { - Ok(TestOutcome { - outcome: Err(mut msg), - codegen_output, - compilation_output, - test_output, - }) => Err(Failed::from({ - write!( - &mut msg, - "\n\nCODEGEN:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", - codegen_output.stdout, codegen_output.stderr - ) - .unwrap(); - if let Some(compilation_output) = compilation_output { - write!( - &mut msg, - "\n\nCARGO CHECK:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", - compilation_output.stdout, compilation_output.stderr - ) - .unwrap(); - } - if let Some(test_output) = test_output { - write!( - &mut msg, - "\n\nCARGO TEST:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", - test_output.stdout, test_output.stderr - ) - .unwrap(); +impl CodegenTestOutcome { + fn into_trial( + self, + test_name: &str, + test_config: &TestConfig, + codegen_output: Option<&CommandOutput>, + ) -> Trial { + let codegen_test_name = format!("{test_name}::codegen"); + match self { + CodegenTestOutcome::Success => Trial::test(codegen_test_name, || Ok(())), + CodegenTestOutcome::Failure { msg } => { + let msg = if let Some(codegen_output) = codegen_output { + enrich_codegen_failure_message(codegen_output, test_config, &msg) + } else { + msg + }; + let msg = enrich_failure_message(test_config, msg); + Trial::test(codegen_test_name, move || Err(Failed::from(msg))) } - enrich_failure_message(&test.configuration, msg) - })), - Err(e) => Err(Failed::from(enrich_failure_message( - &test.configuration, - unexpected_failure_message(&e), - ))), - Ok(TestOutcome { - outcome: Ok(()), .. - }) => Ok(()), + } } } -fn _run_test( +fn code_generation_test( runtime_directory: &Path, test: &TestData, pavexc_cli: &Path, -) -> Result { +) -> (Option, CodegenTestOutcome) { let binary_name = format!("app_{}", test.name_hash); - let timer = std::time::Instant::now(); - println!("Running {binary_name}"); let binary = runtime_directory .join("target") .join("debug") .join(&binary_name); - let output = std::process::Command::new(binary) + let output = match std::process::Command::new(binary) .env("PAVEX_PAVEXC", pavexc_cli) .current_dir(&test.runtime_directory) .output() - .context("Failed to perform code generation")?; - println!("Ran {binary_name} in {} seconds", timer.elapsed().as_secs()); - - let codegen_output: CommandOutput = (&output).try_into()?; - - let expectations_directory = test.definition_directory.join("expectations"); + { + Ok(o) => o, + Err(e) => { + let msg = format!("Failed to invoke the code generator.\n{:?}", e); + return (None, CodegenTestOutcome::Failure { msg }); + } + }; + let codegen_output = match CommandOutput::try_from(&output) { + Ok(o) => o, + Err(e) => { + let msg = format!("Failed to convert the code generator output.\n{:?}", e); + return (None, CodegenTestOutcome::Failure { msg }); + } + }; - if !output.status.success() { - return match test.configuration.expectations.codegen { - ExpectedOutcome::Pass => Ok(TestOutcome { - outcome: Err("We failed to generate the application code.".to_string()), - codegen_output, - compilation_output: None, - test_output: None, - }), + let expectations_directory = test.expectations_directory(); + let outcome = if !output.status.success() { + match test.configuration.expectations.codegen { + ExpectedOutcome::Pass => CodegenTestOutcome::Failure { + msg: "We failed to generate the application code.".into(), + }, ExpectedOutcome::Fail => { let stderr_snapshot = SnapshotTest::new( expectations_directory.join("stderr.txt"), test.blueprint_crate_name(), ); if stderr_snapshot.verify(&codegen_output.stderr).is_err() { - return Ok(TestOutcome { - outcome: Err("The failure message returned by code generation doesn't match what we expected".into()), - codegen_output, - compilation_output: None, - test_output: None, - }); + CodegenTestOutcome::Failure { msg: "The failure message returned by code generation doesn't match what we expected".into() } + } else { + CodegenTestOutcome::Success } - Ok(TestOutcome { - outcome: Ok(()), - codegen_output, - compilation_output: None, - test_output: None, - }) } - }; + } } else if ExpectedOutcome::Fail == test.configuration.expectations.codegen { - return Ok(TestOutcome { - outcome: Err("We expected code generation to fail, but it succeeded!".into()), - codegen_output, - compilation_output: None, - test_output: None, - }); + CodegenTestOutcome::Failure { + msg: "We expected code generation to fail, but it succeeded!".into(), + } + } else { + CodegenTestOutcome::Success }; + (Some(codegen_output), outcome) +} - if let ExpectedOutcome::Fail = test.configuration.expectations.lints { - let stderr_snapshot = SnapshotTest::new( - expectations_directory.join("stderr.txt"), - test.blueprint_crate_name(), +fn code_generation_lints_test( + data: &TestData, + test_name: &str, + codegen_output: &CommandOutput, +) -> Option { + let ExpectedOutcome::Fail = data.configuration.expectations.lints else { + return None; + }; + + let stderr_snapshot = SnapshotTest::new( + data.expectations_directory().join("stderr.txt"), + data.blueprint_crate_name(), + ); + let lints_test_name = format!("{test_name}::codegen_lints"); + let trial = if stderr_snapshot.verify(&codegen_output.stderr).is_err() { + let msg = enrich_codegen_failure_message( + &codegen_output, + &data.configuration, + "The warnings returned by code generation don't match what we expected", ); - if stderr_snapshot.verify(&codegen_output.stderr).is_err() { - return Ok(TestOutcome { - outcome: Err( - "The warnings returned by code generation don't match what we expected".into(), - ), - codegen_output, - compilation_output: None, - test_output: None, - }); - } - } + Trial::test(lints_test_name, move || Err(Failed::from(msg))) + } else { + Trial::test(lints_test_name, || Ok(())) + }; + Some(trial) +} + +fn enrich_codegen_failure_message( + codegen_output: &CommandOutput, + configuration: &TestConfig, + msg: &str, +) -> String { + let msg = format!( + "{msg}\n\nCODEGEN:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", + codegen_output.stdout, codegen_output.stderr + ); + enrich_failure_message(configuration, msg) +} +fn code_generation_diagnostics_test(test_name: &str, test: &TestData) -> Trial { + let test_name = format!("{test_name}::codegen_diagnostics"); + let expectations_directory = test.expectations_directory(); let diagnostics_snapshot = SnapshotTest::new( expectations_directory.join("diagnostics.dot"), test.blueprint_crate_name(), ); let actual_diagnostics = - fs_err::read_to_string(test.runtime_directory.join("diagnostics.dot"))?; - // We don't exit early here to get the generated code snapshot as well. - // This allows to update both code snapshot and diagnostics snapshot in one go via - // `cargo r --bin snaps` for a failing test instead of having to do them one at a time, - // with a test run in the middle. - let diagnostics_outcome = diagnostics_snapshot.verify(&actual_diagnostics); + match fs_err::read_to_string(test.runtime_directory.join("diagnostics.dot")) { + Ok(d) => d, + Err(e) => { + let msg = format!( + "Code generation didn't produce a diagnostic file in the expected location.\n{:?}", + e + ); + return Trial::test(test_name, move || Err(Failed::from(msg))); + } + }; + if diagnostics_snapshot.verify(&actual_diagnostics).is_err() { + let msg = + "The diagnostics returned by code generation don't match what we expected.".to_string(); + Trial::test(test_name, move || Err(Failed::from(msg))) + } else { + Trial::test(test_name, || Ok(())) + } +} +fn application_code_test(test_name: &str, test: &TestData) -> Trial { + let test_name = format!("{test_name}::app_code"); + let expectations_directory = test.expectations_directory(); let app_code_snapshot = SnapshotTest::new( expectations_directory.join("app.rs"), test.blueprint_crate_name(), ); let generated_code_path = test.generated_app_directory().join("src").join("lib.rs"); - let actual_app_code = fs_err::read_to_string(generated_code_path).unwrap(); - let codegen_outcome = app_code_snapshot.verify(&actual_app_code); + let actual_app_code = match fs_err::read_to_string(generated_code_path) { + Ok(d) => d, + Err(e) => { + let msg = format!( + "Code generation didn't produce a `lib.rs` file in the expected location.\n{:?}", + e + ); + return Trial::test(test_name, move || Err(Failed::from(msg))); + } + }; + if app_code_snapshot.verify(&actual_app_code).is_err() { + let msg = "The generated application code doesn't match what we expected.".to_string(); + Trial::test(test_name, move || Err(Failed::from(msg))) + } else { + Trial::test(test_name, || Ok(())) + } +} +fn application_code_compilation_test(test: &TestData) -> Result<(), anyhow::Error> { // Check that the generated code compiles let output = std::process::Command::new("cargo") // .env("RUSTFLAGS", "-Awarnings") @@ -839,75 +957,42 @@ fn _run_test( .arg("--quiet") .current_dir(&test.runtime_directory) .output() - .unwrap(); + .context("Failed to invoke `cargo check` on the generated application code")?; let compilation_output: Result = (&output).try_into(); - - if diagnostics_outcome.is_err() { - return Ok(TestOutcome { - outcome: Err( - "Diagnostics for the generated application don't match what we expected".into(), - ), - codegen_output, - compilation_output: None, - test_output: None, - }); - } - - if codegen_outcome.is_err() { - return Ok(TestOutcome { - outcome: Err("The generated application code doesn't match what we expected".into()), - codegen_output, - compilation_output: None, - test_output: None, - }); - } - - let compilation_output = compilation_output?; + let compilation_output = + compilation_output.context("The output of `cargo check` contains non-UTF8 characters")?; if !output.status.success() { - return Ok(TestOutcome { - outcome: Err("The generated application code doesn't compile.".into()), - codegen_output, - compilation_output: Some(compilation_output), - test_output: None, - }); - } - - // Run integration tests, if we have any, - if let ShouldRunTests::Yes = test.should_run_tests() { - let output = std::process::Command::new("cargo") - // .env("RUSTFLAGS", "-Awarnings") - .arg("t") - .arg("--jobs") - .arg("1") - .arg("-p") - .arg(format!("integration_{}", test.name_hash)) - .current_dir(&test.runtime_directory) - .output() - .unwrap(); - let test_output: CommandOutput = (&output).try_into()?; - if !output.status.success() { - return Ok(TestOutcome { - outcome: Err("Integration tests failed.".into()), - codegen_output, - test_output: Some(test_output), - compilation_output: Some(compilation_output), - }); - } + anyhow::bail!( + "The generated application code doesn't compile.\n\nCARGO CHECK:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", + compilation_output.stdout, compilation_output.stderr + ) + } else { + Ok(()) } - - Ok(TestOutcome { - outcome: Ok(()), - codegen_output, - compilation_output: Some(compilation_output), - test_output: None, - }) } -struct TestOutcome { - outcome: Result<(), String>, - codegen_output: CommandOutput, - compilation_output: Option, - test_output: Option, +fn application_integration_test(test: &TestData) -> Result<(), anyhow::Error> { + let output = std::process::Command::new("cargo") + // .env("RUSTFLAGS", "-Awarnings") + .arg("t") + .arg("--jobs") + .arg("1") + .arg("-p") + .arg(format!("integration_{}", test.name_hash)) + .current_dir(&test.runtime_directory) + .output() + .context("Failed to invoke `cargo test` on the app integration tests")?; + let test_output: CommandOutput = (&output) + .try_into() + .context("The output of `cargo test` contains non-UTF8 characters")?; + if !output.status.success() { + anyhow::bail!( + "Integration tests didn't succeed.\n\nCARGO TEST:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", + test_output.stdout, test_output.stderr + ) + } else { + Ok(()) + } } /// A refined `std::process::Output` that assumes that both stderr and stdout are valid UTF8. @@ -931,13 +1016,6 @@ impl TryFrom<&Output> for CommandOutput { } } -fn unexpected_failure_message(e: &anyhow::Error) -> String { - format!( - "An unexpected error was encountered when running a test.\n\n{}\n---\n{:?}", - &e, &e - ) -} - fn enrich_failure_message(config: &TestConfig, error: impl AsRef) -> String { let description = style(textwrap::indent(&config.description, " ")).cyan(); let error = style(textwrap::indent(error.as_ref(), " ")).red(); diff --git a/libs/pavex_test_runner/src/target_directory.rs b/libs/pavex_test_runner/src/target_directory.rs deleted file mode 100644 index 4e87b98ab..000000000 --- a/libs/pavex_test_runner/src/target_directory.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! Assigning a distinct target directory to each test case doesn't scale. -//! Those directories are big and can easily fill up your disk (and they -//! have started to do so once the number of tests grew to 50+). -//! -//! This module provides functionality to re-use target directories across -//! different test cases. -//! We create N target directories, where N is the number of cores on the -//! machine. Each test case is assigned a target directory from this pool -//! once it kicks off. -//! Since the test runner doesn't execute more than N test cases in -//! parallel, this approach guarantees that test cases don't have to wait -//! to be assigned a target directory (i.e. we still get maximum parallelism). -//! -//! We can't reuse the same target directory for all tests since each test -//! needs to acquire a unique lock on the target directory in order to -//! execute `cargo` commands. Having a single target directory would -//! serialize all tests, which would be a huge performance hit. - -use std::{ - path::{Path, PathBuf}, - sync::Arc, -}; - -use object_pool::Reusable; - -#[derive(Clone)] -pub struct TargetDirectoryPool { - directories: Arc>, -} - -impl TargetDirectoryPool { - pub fn new(size: Option, test_env_dir: &Path) -> Self { - let size = size.unwrap_or_else(num_cpus::get); - // The function signature here is awkward because it doesn't allow us to - // borrow from the environment in the closure, which in turns means we can't guarantee deterministic names for the target directories. - // We work around the issue by attaching objects to the pool manually - let directories = object_pool::Pool::new(0, || { - panic!("Target directories should never be initialized via the init closure") - }); - for i in 0..size { - directories.attach(create_target_directory(test_env_dir, i)); - } - Self { - directories: Arc::new(directories), - } - } - - /// Pull a target directory from the pool. - pub fn pull(&self) -> Reusable<'_, PathBuf> { - self.directories - .try_pull() - .expect("Failed to pull a target directory from the pool") - } -} - -fn create_target_directory(test_env_dir: &Path, i: usize) -> PathBuf { - let target_dir_path = test_env_dir - .join("target_dirs") - .join(format!("target_{:0>2}", i)); - fs_err::create_dir_all(&target_dir_path).expect("Failed to create target directory"); - target_dir_path -} From 1353ecd36220fea5e233e5c31805e33efe25b04d Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Tue, 24 Sep 2024 13:31:21 +0200 Subject: [PATCH 06/16] Run codegen in parallel --- libs/Cargo.lock | 1 + libs/pavex_test_runner/Cargo.toml | 1 + libs/pavex_test_runner/src/lib.rs | 81 +++++++++++++++++++++---------- 3 files changed, 57 insertions(+), 26 deletions(-) diff --git a/libs/Cargo.lock b/libs/Cargo.lock index 8b4eba678..d254d25cc 100644 --- a/libs/Cargo.lock +++ b/libs/Cargo.lock @@ -2311,6 +2311,7 @@ dependencies = [ "pavexc", "persist_if_changed", "px_workspace_hack", + "rayon", "regex", "serde", "serde_json", diff --git a/libs/pavex_test_runner/Cargo.toml b/libs/pavex_test_runner/Cargo.toml index e2f94be29..293e9e7c8 100644 --- a/libs/pavex_test_runner/Cargo.toml +++ b/libs/pavex_test_runner/Cargo.toml @@ -36,3 +36,4 @@ once_cell = { workspace = true } px_workspace_hack = { version = "0.1", path = "../px_workspace_hack" } pavexc = { path = "../pavexc" } guppy = { workspace = true } +rayon = { workspace = true } diff --git a/libs/pavex_test_runner/src/lib.rs b/libs/pavex_test_runner/src/lib.rs index 49da8e546..4d758b564 100644 --- a/libs/pavex_test_runner/src/lib.rs +++ b/libs/pavex_test_runner/src/lib.rs @@ -10,6 +10,7 @@ use itertools::Itertools; use libtest_mimic::{Arguments, Conclusion, Failed, Trial}; use pavexc::rustdoc::CrateCollection; use pavexc::DEFAULT_DOCS_TOOLCHAIN; +use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use sha2::Digest; use toml::toml; use walkdir::WalkDir; @@ -80,40 +81,62 @@ pub fn run_tests( create_tests_dir(&runtime_directory, &test_name2test_data, &pavex_cli)?; - let mut trials = Vec::new(); + let mut trials = Vec::with_capacity(test_name2test_data.len() * 4); if !arguments.list { warm_up_target_dir(&runtime_directory)?; warm_up_rustdoc_cache(&runtime_directory, &test_name2test_data)?; - // TODO: We need to run them in parallel. - for (name, data) in test_name2test_data { - let (codegen_output, outcome) = - code_generation_test(&runtime_directory, &data, &pavexc_cli); - let is_success = outcome == CodegenTestOutcome::Success; - let trial = outcome.into_trial(&name, &data.configuration, codegen_output.as_ref()); - trials.push(trial); - - // If the code generation test failed, we skip the follow-up tests. - if !is_success { - continue; - } + // First battery of the UI tests. + // For each UI test, we run code generation and then generate a different + // "test case" for each assertion that's relevant to the code generation process. + // If all assertions pass, we return a `bool` set to `true` which indicates + // that we want to run the second battery of assertions on that UI test. + let intermediate: BTreeMap, bool)> = test_name2test_data + .par_iter() + .map(|(name, data)| { + let mut trials = Vec::new(); + let (codegen_output, outcome) = + code_generation_test(&runtime_directory, &data, &pavexc_cli); + let is_success = outcome == CodegenTestOutcome::Success; + let trial = outcome.into_trial(&name, &data.configuration, codegen_output.as_ref()); + trials.push(trial); + + // If the code generation test failed, we skip the follow-up tests. + if !is_success { + return (name.to_owned(), (trials, false)); + } - if let Some(codegen_output) = codegen_output { - if let Some(trial) = code_generation_lints_test(&data, &name, &codegen_output) { - trials.push(trial); + if let Some(codegen_output) = codegen_output { + if let Some(trial) = code_generation_lints_test(&data, &name, &codegen_output) { + trials.push(trial); + } + }; + + if data.configuration.expectations.codegen == ExpectedOutcome::Fail { + return (name.to_owned(), (trials, false)); } - }; - if data.configuration.expectations.codegen == ExpectedOutcome::Fail { - continue; - } + let trial = code_generation_diagnostics_test(&name, &data); + trials.push(trial); + + let trial = application_code_test(&name, &data); + trials.push(trial); + (name.to_owned(), (trials, true)) + }) + .collect(); - let trial = code_generation_diagnostics_test(&name, &data); - trials.push(trial); + let test_name2test_data: BTreeMap<_, _> = test_name2test_data + .into_iter() + .filter(|(k, _)| intermediate[k].1) + .collect(); - let trial = application_code_test(&name, &data); - trials.push(trial); + // Save the results of the first battery of tests. + intermediate.into_values().for_each(|(partial, _)| { + trials.extend(partial); + }); + // TODO: We need to run them in parallel. + for (name, data) in test_name2test_data { let trial_name = format!("{}::app_code_compiles", name); match application_code_compilation_test(&data) { Ok(_) => { @@ -258,8 +281,13 @@ fn warm_up_rustdoc_cache( )?; let mut crates = test_name2test_data .values() - .map(|data| format!("app_{}", data.name_hash)) - // TODO: we need to include locally-defined dependency crates as well + .flat_map(|data| { + data.configuration + .ephemeral_dependencies + .keys() + .map(|name| format!("{name}_{}", data.name_hash)) + .chain(std::iter::once(format!("app_{}", data.name_hash))) + }) .collect::>(); // Hand-picked crates that we know we're going to build docs for. crates.insert("pavex".into()); @@ -561,6 +589,7 @@ impl TestData { [lints.rust] unexpected_cfgs = { level = "allow", check-cfg = ["cfg(pavex_ide_hint)"] } + unused = { level = "allow" } [dependencies] pavex = { workspace = true } From 082e0b5d871890f61f56cc9df990347f812b5f45 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:29:35 +0200 Subject: [PATCH 07/16] Make sure to avoid busting the cache --- libs/Cargo.lock | 1 + libs/Cargo.toml | 1 + libs/pavex_test_runner/Cargo.toml | 1 + libs/pavex_test_runner/src/lib.rs | 193 ++++++++++++++++++++---------- 4 files changed, 132 insertions(+), 64 deletions(-) diff --git a/libs/Cargo.lock b/libs/Cargo.lock index d254d25cc..183d606ee 100644 --- a/libs/Cargo.lock +++ b/libs/Cargo.lock @@ -2298,6 +2298,7 @@ version = "0.1.48" dependencies = [ "ahash", "anyhow", + "cargo_metadata", "console", "fs-err", "globwalk", diff --git a/libs/Cargo.toml b/libs/Cargo.toml index e13cb4dbe..865f75610 100644 --- a/libs/Cargo.toml +++ b/libs/Cargo.toml @@ -27,6 +27,7 @@ biscotti = "0.3" bytes = "1.5.0" camino = "1" cargo-like-utils = "0.1.2" +cargo_metadata = "0.18.0" cargo-manifest = "0.14.0" clap = "4" clap-stdin = "0.4.0" diff --git a/libs/pavex_test_runner/Cargo.toml b/libs/pavex_test_runner/Cargo.toml index 293e9e7c8..e6e2a8eed 100644 --- a/libs/pavex_test_runner/Cargo.toml +++ b/libs/pavex_test_runner/Cargo.toml @@ -15,6 +15,7 @@ dist = false anyhow = { workspace = true } ahash = { workspace = true } console = { workspace = true } +cargo_metadata = { workspace = true } fs-err = { workspace = true } libtest-mimic = { workspace = true } serde = { workspace = true, features = ["derive"] } diff --git a/libs/pavex_test_runner/src/lib.rs b/libs/pavex_test_runner/src/lib.rs index 4d758b564..153f135b4 100644 --- a/libs/pavex_test_runner/src/lib.rs +++ b/libs/pavex_test_runner/src/lib.rs @@ -1,10 +1,11 @@ -use std::collections::BTreeMap; +use std::collections::{BTreeMap, BTreeSet}; use std::fmt::Write; use std::path::{Component, Path, PathBuf}; use std::process::{Command, Output}; use ahash::{HashMap, HashSet}; use anyhow::Context; +use cargo_metadata::diagnostic::DiagnosticLevel; use console::style; use itertools::Itertools; use libtest_mimic::{Arguments, Conclusion, Failed, Trial}; @@ -83,14 +84,17 @@ pub fn run_tests( let mut trials = Vec::with_capacity(test_name2test_data.len() * 4); if !arguments.list { - warm_up_target_dir(&runtime_directory)?; warm_up_rustdoc_cache(&runtime_directory, &test_name2test_data)?; + warm_up_target_dir(&runtime_directory, &test_name2test_data)?; // First battery of the UI tests. // For each UI test, we run code generation and then generate a different // "test case" for each assertion that's relevant to the code generation process. // If all assertions pass, we return a `bool` set to `true` which indicates // that we want to run the second battery of assertions on that UI test. + let n_codegen_tests = test_name2test_data.len(); + let timer = std::time::Instant::now(); + println!("Performing code generation for {n_codegen_tests} tests"); let intermediate: BTreeMap, bool)> = test_name2test_data .par_iter() .map(|(name, data)| { @@ -124,6 +128,10 @@ pub fn run_tests( (name.to_owned(), (trials, true)) }) .collect(); + println!( + "Performed code generation for {n_codegen_tests} tests in {} seconds", + timer.elapsed().as_secs() + ); let test_name2test_data: BTreeMap<_, _> = test_name2test_data .into_iter() @@ -135,10 +143,22 @@ pub fn run_tests( trials.extend(partial); }); + let (cases, test_name2test_data) = + compile_generated_apps(&runtime_directory, test_name2test_data)?; + + trials.extend(cases); + // TODO: We need to run them in parallel. + let test_name2test_data: BTreeMap<_, _> = test_name2test_data + .into_iter() + .filter(|(_, data)| data.should_run_tests()) + .collect(); + let n_integration_cases = test_name2test_data.len(); + println!("Running integration tests for {n_integration_cases} test cases"); + let timer = std::time::Instant::now(); for (name, data) in test_name2test_data { - let trial_name = format!("{}::app_code_compiles", name); - match application_code_compilation_test(&data) { + let trial_name = format!("{}::app_integration_tests", name); + match application_integration_test(&data) { Ok(_) => { let trial = Trial::test(trial_name, || Ok(())); trials.push(trial); @@ -147,31 +167,101 @@ pub fn run_tests( let msg = format!("{err:?}"); let trial = Trial::test(trial_name, move || Err(Failed::from(msg))); trials.push(trial); - - // We skip the follow-up tests if the application code compilation test failed. - continue; - } - } - - if data.should_run_tests() { - let trial_name = format!("{}::app_integration_tests", name); - match application_integration_test(&data) { - Ok(_) => { - let trial = Trial::test(trial_name, || Ok(())); - trials.push(trial); - } - Err(err) => { - let msg = format!("{err:?}"); - let trial = Trial::test(trial_name, move || Err(Failed::from(msg))); - trials.push(trial); - } } } } + println!( + "Ran integration tests for {n_integration_cases} test cases in {} seconds", + timer.elapsed().as_secs() + ); } Ok(libtest_mimic::run(&arguments, trials)) } +fn compile_generated_apps( + runtime_directory: &Path, + test_name2test_data: BTreeMap, +) -> Result<(Vec, BTreeMap), anyhow::Error> { + let generated_crate_names = test_name2test_data + .values() + .map(|data| data.generated_crate_name()) + .collect::>(); + let timer = std::time::Instant::now(); + println!("Compiling {} generated crates", generated_crate_names.len()); + let mut cmd = Command::new("cargo"); + cmd.arg("check").arg("--message-format").arg("json"); + for name in &generated_crate_names { + cmd.arg("-p").arg(name); + } + let output = cmd + .arg("--all-targets") + .current_dir(runtime_directory) + .output() + .context("Failed to invoke `cargo build` on the generated crates")?; + let build_output = CommandOutput::try_from(&output).context("Failed to parse build output")?; + let mut crate_names2error = BTreeMap::<_, String>::new(); + for line in build_output.stderr.lines() { + let Ok(json) = serde_json::from_str::(line) else { + // Not all output lines are JSON, so we ignore the ones that aren't. + continue; + }; + // We are primarily looking for errors here. + let cargo_metadata::Message::CompilerMessage(msg) = json else { + continue; + }; + if msg.message.level == DiagnosticLevel::Error + || msg.message.level == DiagnosticLevel::FailureNote + { + let package_name_and_version = msg + .package_id + .repr + .split_once('#') + .expect("Missing package name") + .1; + let package_name = package_name_and_version + .split_once('@') + .expect("Missing version") + .0; + assert!( + generated_crate_names.contains(package_name), + "Error compiling a crate that's not one of ours, {}", + msg.package_id.repr + ); + let errors = crate_names2error + .entry(package_name.to_owned()) + .or_default(); + writeln!( + errors, + "{}", + msg.message.rendered.unwrap_or(msg.message.message) + ) + .unwrap(); + } + } + let mut trials = Vec::new(); + let mut further = BTreeMap::new(); + for (test_name, data) in test_name2test_data { + let error = crate_names2error.get(&data.generated_crate_name()).cloned(); + let case_name = format!("{test_name}::app_code_compiles"); + let trial = if let Some(error) = error { + Trial::test(case_name, move || Err(Failed::from(error))) + } else { + further.insert(test_name, data); + Trial::test(case_name, || Ok(())) + }; + trials.push(trial); + } + if !output.status.success() && crate_names2error.is_empty() { + panic!("Something went wrong when compiling the generated crates, but we failed to capture what or where.") + } + println!( + "Compiled {} generated crates in {} seconds", + generated_crate_names.len(), + timer.elapsed().as_secs(), + ); + Ok((trials, further)) +} + // Inlined from `libtest_mimic` to further control the test execution. // We ignore test kind since we don't have benches in our UI test suite. fn is_filtered_out(args: &Arguments, test_name: &str) -> bool { @@ -199,7 +289,10 @@ fn is_filtered_out(args: &Arguments, test_name: &str) -> bool { /// Compile all binary targets of the type `app_*`. /// This ensures that all dependencies have been compiled, speeding up further operations, /// as well as preparing the binaries that each test will invoke. -fn warm_up_target_dir(runtime_directory: &Path) -> Result<(), anyhow::Error> { +fn warm_up_target_dir( + runtime_directory: &Path, + test_name2test_data: &BTreeMap, +) -> Result<(), anyhow::Error> { println!("Creating a workspace-hack crate to unify dependencies"); // Clean up pre-existing workspace_hack, since `cargo hakari init` will fail @@ -246,8 +339,11 @@ fn warm_up_target_dir(runtime_directory: &Path) -> Result<(), anyhow::Error> { let timer = std::time::Instant::now(); println!("Warming up the target directory"); let mut cmd = Command::new("cargo"); - cmd.arg("build") - .arg("--bins") + cmd.arg("build"); + for data in test_name2test_data.values() { + cmd.arg("-p").arg(data.blueprint_crate_name()); + } + cmd.arg("--all-targets") .stdout(std::process::Stdio::inherit()) .stderr(std::process::Stdio::inherit()) .current_dir(runtime_directory); @@ -541,6 +637,10 @@ impl TestData { format!("app_{}", self.name_hash) } + fn generated_crate_name(&self) -> String { + format!("application_{}", self.name_hash) + } + fn integration_test_directory(&self) -> Option { self.has_tests .then(|| self.runtime_directory.join("integration")) @@ -741,17 +841,6 @@ impl TestData { let cargo_config = toml! { [build] incremental = false - - [target.x86_64-pc-windows-msvc] - rustflags = ["-C", "link-arg=-fuse-ld=lld"] - [target.x86_64-pc-windows-gnu] - rustflags = ["-C", "link-arg=-fuse-ld=lld"] - [target.x86_64-unknown-linux-gnu] - rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"] - [target.x86_64-apple-darwin] - rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld"] - [target.aarch64-apple-darwin] - rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld"] }; let dot_cargo_folder = self.runtime_directory.join(".cargo"); fs_err::create_dir_all(&dot_cargo_folder)?; @@ -974,41 +1063,17 @@ fn application_code_test(test_name: &str, test: &TestData) -> Trial { } } -fn application_code_compilation_test(test: &TestData) -> Result<(), anyhow::Error> { - // Check that the generated code compiles - let output = std::process::Command::new("cargo") - // .env("RUSTFLAGS", "-Awarnings") - .arg("check") - .arg("--jobs") - .arg("1") - .arg("-p") - .arg(format!("application_{}", test.name_hash)) - .arg("--quiet") - .current_dir(&test.runtime_directory) - .output() - .context("Failed to invoke `cargo check` on the generated application code")?; - let compilation_output: Result = (&output).try_into(); - let compilation_output = - compilation_output.context("The output of `cargo check` contains non-UTF8 characters")?; - if !output.status.success() { - anyhow::bail!( - "The generated application code doesn't compile.\n\nCARGO CHECK:\n\t--- STDOUT:\n{}\n\t--- STDERR:\n{}", - compilation_output.stdout, compilation_output.stderr - ) - } else { - Ok(()) - } -} - fn application_integration_test(test: &TestData) -> Result<(), anyhow::Error> { let output = std::process::Command::new("cargo") // .env("RUSTFLAGS", "-Awarnings") .arg("t") - .arg("--jobs") - .arg("1") + // .arg("--jobs") + // .arg("1") .arg("-p") .arg(format!("integration_{}", test.name_hash)) .current_dir(&test.runtime_directory) + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()) .output() .context("Failed to invoke `cargo test` on the app integration tests")?; let test_output: CommandOutput = (&output) From a14b1955bff3c740f01fb4d1a4f9b3ca8cdc9a3d Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:41:25 +0200 Subject: [PATCH 08/16] Rework tests --- .gitignore | 3 +- libs/pavex_cli/tests/ui_tests.rs | 13 +- libs/pavex_test_runner/Cargo.toml | 4 + libs/pavex_test_runner/src/lib.rs | 264 +- libs/pavex_test_runner/src/main.rs | 2 +- libs/ui_tests/.cargo/config.toml | 2 + libs/ui_tests/.config/hakari.toml | 25 + libs/ui_tests/Cargo.lock | 2600 +++++++++++++++++ libs/ui_tests/Cargo.toml | 12 + libs/ui_tests/app_builder/Cargo.toml | 17 + libs/ui_tests/app_builder/diagnostics.dot | 67 + .../ui_tests/app_builder/expectations/app.rs | 0 .../app_builder/expectations/diagnostics.dot | 0 .../app_builder/generated_app/Cargo.toml | 16 + .../app_builder/generated_app/blueprint.ron | 120 + .../app_builder/generated_app/src/lib.rs | 196 ++ .../app_builder/src}/lib.rs | 0 libs/ui_tests/app_builder/src/main.rs | 24 + .../ui_tests/app_builder/test_config.toml | 0 .../async_callable_are_supported/Cargo.toml | 17 + .../diagnostics.dot | 55 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 107 + .../generated_app/src/lib.rs | 179 ++ .../async_callable_are_supported/src}/lib.rs | 0 .../async_callable_are_supported/src/main.rs | 24 + .../test_config.toml | 0 .../cannot_return_the_unit_type/Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 299 ++ .../generated_app/src/lib.rs | 0 .../cannot_return_the_unit_type/src}/lib.rs | 0 .../cannot_return_the_unit_type/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 96 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 87 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 87 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../common/components_can_fail/Cargo.toml | 20 + .../components_can_fail/diagnostics.dot | 223 ++ .../components_can_fail/expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 236 ++ .../generated_app/src/lib.rs | 407 +++ .../common/components_can_fail/src}/lib.rs | 0 .../common/components_can_fail/src/main.rs | 24 + .../components_can_fail/test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 136 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 3 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 15 + .../generated_app/blueprint.ron | 29 + .../generated_app/src/lib.rs | 101 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 90 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 94 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 149 + .../generated_app/src/lib.rs | 204 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../.atomicwritevn0J69/tmpfile.tmp | 17 + .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 83 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 45 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 158 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 20 + .../diagnostics.dot | 41 + .../ephemeral_deps/dep/Cargo.toml | 14 + .../ephemeral_deps/dep/src/lib.rs} | 0 .../expectations/app.rs | 2 +- .../expectations/diagnostics.dot | 41 + .../generated_app/Cargo.toml | 17 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 153 + .../src}/lib.rs | 6 +- .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 41 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 153 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 3 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 15 + .../generated_app/blueprint.ron | 31 + .../generated_app/src/lib.rs | 101 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 63 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 63 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 106 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 117 + .../generated_app/src/lib.rs | 230 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 43 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 63 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 149 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 57 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 25 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 25 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 89 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 128 + .../generated_app/src/lib.rs | 219 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 45 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 141 + .../generated_app/src/lib.rs | 155 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../nest_at_prefix_is_validated/Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 57 + .../generated_app/src/lib.rs | 0 .../nest_at_prefix_is_validated/src}/lib.rs | 0 .../nest_at_prefix_is_validated/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 108 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 108 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 128 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 47 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../finalizer_pattern/Cargo.toml | 17 + .../finalizer_pattern/diagnostics.dot | 105 + .../finalizer_pattern/expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 101 + .../generated_app/src/lib.rs | 207 ++ .../finalizer_pattern/src}/lib.rs | 0 .../finalizer_pattern/src/main.rs | 24 + .../finalizer_pattern/test_config.toml | 0 .../must_take_response_as_input/Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 47 + .../generated_app/src/lib.rs | 0 .../must_take_response_as_input/src}/lib.rs | 0 .../must_take_response_as_input/src/main.rs | 24 + .../test_config.toml | 0 .../post_process_without_wrapping/Cargo.toml | 17 + .../diagnostics.dot | 55 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 47 + .../generated_app/src/lib.rs | 166 ++ .../post_process_without_wrapping/src}/lib.rs | 0 .../post_process_without_wrapping/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 81 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../pre_process_without_wrapping/Cargo.toml | 17 + .../diagnostics.dot | 47 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 47 + .../generated_app/src/lib.rs | 168 ++ .../pre_process_without_wrapping/src}/lib.rs | 0 .../pre_process_without_wrapping/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 81 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../prebuilts/invalid_prebuilt/Cargo.toml | 17 + .../invalid_prebuilt/expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../invalid_prebuilt/expectations/stderr.txt | 0 .../invalid_prebuilt/generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 98 + .../invalid_prebuilt/generated_app/src/lib.rs | 0 .../prebuilts/invalid_prebuilt/src}/lib.rs | 0 .../prebuilts/invalid_prebuilt/src/main.rs | 24 + .../invalid_prebuilt/test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 47 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 67 + .../generated_app/src/lib.rs | 158 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../prebuilts/prebuilt_works/Cargo.toml | 17 + .../prebuilts/prebuilt_works/diagnostics.dot | 63 + .../prebuilt_works/expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../prebuilt_works/generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 98 + .../prebuilt_works/generated_app/src/lib.rs | 207 ++ .../prebuilts/prebuilt_works/src}/lib.rs | 0 .../prebuilts/prebuilt_works/src/main.rs | 24 + .../prebuilts/prebuilt_works/test_config.toml | 0 .../prebuilts_can_be_cloned/Cargo.toml | 17 + .../prebuilts_can_be_cloned/diagnostics.dot | 54 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 67 + .../generated_app/src/lib.rs | 181 ++ .../prebuilts_can_be_cloned/src}/lib.rs | 0 .../prebuilts_can_be_cloned/src/main.rs | 24 + .../prebuilts_can_be_cloned/test_config.toml | 0 .../prebuilts/unused_prebuilt/Cargo.toml | 17 + .../prebuilts/unused_prebuilt/diagnostics.dot | 3 + .../unused_prebuilt/expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../unused_prebuilt/expectations/stderr.txt | 0 .../unused_prebuilt/generated_app/Cargo.toml | 15 + .../generated_app/blueprint.ron | 26 + .../unused_prebuilt/generated_app/src/lib.rs | 101 + .../prebuilts/unused_prebuilt/src}/lib.rs | 0 .../prebuilts/unused_prebuilt/src/main.rs | 24 + .../unused_prebuilt/test_config.toml | 0 .../router/ambiguous_fallback/Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 85 + .../generated_app/src/lib.rs | 0 .../router/ambiguous_fallback/src}/lib.rs | 0 .../router/ambiguous_fallback/src/main.rs | 24 + .../ambiguous_fallback/test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 59 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 119 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../router/fallback_priority/Cargo.toml | 17 + .../router/fallback_priority/diagnostics.dot | 83 + .../fallback_priority/expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../fallback_priority/expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 119 + .../generated_app/src/lib.rs | 269 ++ .../fallback_priority/integration/Cargo.toml | 26 + .../fallback_priority/integration/src/lib.rs | 0 .../integration/tests/run.rs} | 0 .../router/fallback_priority/src}/lib.rs | 0 .../router/fallback_priority/src/main.rs | 24 + .../router/fallback_priority/test_config.toml | 0 .../http_method_routing_variants/Cargo.toml | 17 + .../diagnostics.dot | 487 +++ .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 312 ++ .../generated_app/src/lib.rs | 831 ++++++ .../http_method_routing_variants/src}/lib.rs | 0 .../http_method_routing_variants/src/main.rs | 24 + .../test_config.toml | 0 .../blueprint/router/invalid_paths/Cargo.toml | 17 + .../invalid_paths/expectations/stderr.txt | 0 .../invalid_paths/generated_app/Cargo.toml | 8 + .../invalid_paths/generated_app/blueprint.ron | 122 + .../invalid_paths/generated_app/src/lib.rs | 0 .../router/invalid_paths/src}/lib.rs | 0 .../router/invalid_paths/src/main.rs | 24 + .../router/invalid_paths/test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 41 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 153 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../router/route_path_is_validated/Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 51 + .../generated_app/src/lib.rs | 0 .../route_path_is_validated/src}/lib.rs | 0 .../route_path_is_validated/src/main.rs | 24 + .../route_path_is_validated/test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 30 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 47 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../must_take_next_as_input/Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 47 + .../generated_app/src/lib.rs | 0 .../must_take_next_as_input/src}/lib.rs | 0 .../must_take_next_as_input/src/main.rs | 24 + .../must_take_next_as_input/test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 47 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 81 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 103 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 54 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 83 + .../generated_app/src/lib.rs | 166 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 49 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 110 + .../generated_app/src/lib.rs | 156 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 51 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 110 + .../generated_app/src/lib.rs | 157 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 110 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 50 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 168 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 52 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 90 + .../generated_app/src/lib.rs | 161 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 48 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 90 + .../generated_app/src/lib.rs | 156 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../a_copy_type_can_be_moved_twice/Cargo.toml | 17 + .../diagnostics.dot | 46 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 90 + .../generated_app/src/lib.rs | 155 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 90 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 90 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 67 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../borrow_checker/mutability/Cargo.toml | 17 + .../mutability/expectations/app.rs | 0 .../mutability/expectations/diagnostics.dot | 0 .../mutability/expectations/stderr.txt | 0 .../mutability/generated_app/Cargo.toml | 8 + .../mutability/generated_app/blueprint.ron | 70 + .../mutability/generated_app/src/lib.rs | 0 .../borrow_checker/mutability/src}/lib.rs | 0 .../borrow_checker/mutability/src/main.rs | 24 + .../mutability/test_config.toml | 0 .../transitive_borrows/Cargo.toml | 17 + .../transitive_borrows/expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 90 + .../generated_app/src/lib.rs | 0 .../transitive_borrows/src}/lib.rs | 0 .../transitive_borrows/src/main.rs | 24 + .../transitive_borrows/test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 48 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 167 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 50 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 160 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 46 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 155 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 44 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 154 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 70 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 67 + .../generated_app/src/lib.rs | 219 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 39 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 47 + .../generated_app/src/lib.rs | 150 + .../integration/Cargo.toml | 31 + .../integration/src/lib.rs | 0 .../integration/tests/run.rs} | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../connection_info_happy_path/Cargo.toml | 17 + .../diagnostics.dot | 43 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 30 + .../generated_app/src/lib.rs | 166 ++ .../integration/Cargo.toml | 26 + .../integration/src/lib.rs | 0 .../integration/tests/run.rs} | 0 .../connection_info_happy_path/src}/lib.rs | 0 .../connection_info_happy_path/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 76 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 67 + .../generated_app/src/lib.rs | 237 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../cycle_across_a_match_statement/Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 83 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../cycles/request_scoped_cycles/Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 90 + .../generated_app/src/lib.rs | 0 .../cycles/request_scoped_cycles/src}/lib.rs | 0 .../cycles/request_scoped_cycles/src/main.rs | 24 + .../request_scoped_cycles/test_config.toml | 0 .../cycles/transient_cycles/Cargo.toml | 17 + .../transient_cycles/expectations/stderr.txt | 0 .../transient_cycles/generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 90 + .../transient_cycles/generated_app/src/lib.rs | 0 .../cycles/transient_cycles/src}/lib.rs | 0 .../cycles/transient_cycles/src/main.rs | 24 + .../cycles/transient_cycles/test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 102 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 84 + .../generated_app/src/lib.rs | 289 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../elided_lifetimes_are_handled/Cargo.toml | 17 + .../diagnostics.dot | 47 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 161 + .../elided_lifetimes_are_handled/src}/lib.rs | 0 .../elided_lifetimes_are_handled/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 90 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../missing_handler_dependency/Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 30 + .../generated_app/src/lib.rs | 0 .../missing_handler_dependency/src}/lib.rs | 0 .../missing_handler_dependency/src/main.rs | 24 + .../test_config.toml | 0 .../missing_singleton_dependency/Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 0 .../missing_singleton_dependency/src}/lib.rs | 0 .../missing_singleton_dependency/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 97 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 104 + .../generated_app/src/lib.rs | 261 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 49 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 90 + .../generated_app/src/lib.rs | 164 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 343 +++ .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 112 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 132 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 56 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 79 + .../generated_app/src/lib.rs | 166 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 76 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 99 + .../generated_app/src/lib.rs | 190 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../error_observers_happy_path/Cargo.toml | 17 + .../diagnostics.dot | 63 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 115 + .../generated_app/src/lib.rs | 170 ++ .../error_observers_happy_path/src}/lib.rs | 0 .../error_observers_happy_path/src/main.rs | 24 + .../test_config.toml | 0 libs/ui_tests/generated_app/Cargo.toml | 12 + libs/ui_tests/generated_app/src/lib.rs | 166 ++ .../middlewares_execution_order/Cargo.toml | 20 + .../diagnostics.dot | 368 +++ .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 654 +++++ .../generated_app/src/lib.rs | 652 +++++ .../integration/Cargo.toml | 26 + .../integration/src/lib.rs | 0 .../integration/tests/run.rs} | 0 .../middlewares_execution_order/src}/lib.rs | 0 .../middlewares_execution_order/src/main.rs | 24 + .../test_config.toml | 0 .../next_handles_lifetimes/Cargo.toml | 17 + .../next_handles_lifetimes/diagnostics.dot | 79 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 107 + .../generated_app/src/lib.rs | 230 ++ .../next_handles_lifetimes/src}/lib.rs | 0 .../next_handles_lifetimes/src/main.rs | 24 + .../next_handles_lifetimes/test_config.toml | 0 .../next_handles_mut_references/Cargo.toml | 17 + .../diagnostics.dot | 87 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 84 + .../generated_app/src/lib.rs | 235 ++ .../next_handles_mut_references/src}/lib.rs | 0 .../next_handles_mut_references/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 101 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 101 + .../generated_app/src/lib.rs | 254 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../path_parameters_happy_path/Cargo.toml | 21 + .../diagnostics.dot | 159 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 105 + .../generated_app/src/lib.rs | 326 +++ .../integration/Cargo.toml | 26 + .../integration/src/lib.rs | 0 .../integration/tests/run.rs} | 0 .../path_parameters_happy_path/src}/lib.rs | 0 .../path_parameters_happy_path/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 21 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 105 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 21 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 189 ++ .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 30 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 21 + .../diagnostics.dot | 39 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 30 + .../generated_app/src/lib.rs | 152 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../arc_singletons_are_supported/Cargo.toml | 17 + .../diagnostics.dot | 45 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 166 ++ .../arc_singletons_are_supported/src}/lib.rs | 0 .../arc_singletons_are_supported/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 22 + .../diagnostics.dot | 147 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 93 + .../generated_app/src/lib.rs | 307 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 21 + .../diagnostics.dot | 6 +- .../ephemeral_deps/dep/Cargo.toml | 14 + .../ephemeral_deps/dep/src/lib.rs} | 0 .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 17 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 155 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 29 + .../diagnostics.dot | 43 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 18 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 154 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 21 + .../ephemeral_deps/dep/Cargo.toml | 14 + .../ephemeral_deps/dep/src/lib.rs} | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 20 + .../ephemeral_deps/dep_1/Cargo.toml | 14 + .../ephemeral_deps/dep_1/src/lib.rs | 12 + .../ephemeral_deps/dep_2/Cargo.toml | 14 + .../ephemeral_deps/dep_2/src/lib.rs | 12 + .../generated_app/Cargo.toml | 8 + .../generated_app/src/lib.rs | 0 .../src/lib.rs | 14 + .../src/main.rs | 23 + .../Cargo.toml | 21 + .../diagnostics.dot | 43 + .../ephemeral_deps/dep/Cargo.toml | 26 + .../ephemeral_deps/dep/src/lib.rs} | 0 .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 18 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 154 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../generic_handlers_are_supported/Cargo.toml | 17 + .../diagnostics.dot | 41 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 153 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 25 + .../diagnostics.dot | 39 + .../ephemeral_deps/dep_1/Cargo.toml | 14 + .../ephemeral_deps/dep_1/src/lib.rs} | 0 .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 17 + .../generated_app/blueprint.ron | 30 + .../generated_app/src/lib.rs | 154 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../invalid_callable_path/Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 30 + .../generated_app/src/lib.rs | 0 .../invalid_callable_path/src}/lib.rs | 0 .../invalid_callable_path/src/main.rs | 24 + .../invalid_callable_path/test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 67 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 47 + .../generated_app/src/lib.rs | 230 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 30 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 39 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 30 + .../generated_app/src/lib.rs | 152 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 49 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 90 + .../generated_app/src/lib.rs | 166 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 30 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 45 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 160 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../reexported_type_alias_work/Cargo.toml | 21 + .../diagnostics.dot | 45 + .../ephemeral_deps/dep/Cargo.toml | 14 + .../ephemeral_deps/dep/src/lib.rs} | 0 .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 17 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 166 ++ .../reexported_type_alias_work/src}/lib.rs | 0 .../reexported_type_alias_work/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 41 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 153 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 41 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 153 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 20 + .../diagnostics.dot | 51 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 17 + .../generated_app/blueprint.ron | 63 + .../generated_app/src/lib.rs | 164 ++ .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../static_methods_are_supported/Cargo.toml | 17 + .../diagnostics.dot | 39 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 30 + .../generated_app/src/lib.rs | 152 + .../static_methods_are_supported/src}/lib.rs | 0 .../static_methods_are_supported/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 8 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 0 .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../trait_methods_are_supported/Cargo.toml | 17 + .../diagnostics.dot | 52 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 130 + .../generated_app/src/lib.rs | 165 ++ .../trait_methods_are_supported/src}/lib.rs | 0 .../trait_methods_are_supported/src/main.rs | 24 + .../test_config.toml | 0 .../Cargo.toml | 17 + .../diagnostics.dot | 43 + .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 156 + .../src}/lib.rs | 0 .../src/main.rs | 24 + .../test_config.toml | 0 .../tuples_are_supported/Cargo.toml | 17 + .../tuples_are_supported/diagnostics.dot | 45 + .../tuples_are_supported/expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 16 + .../generated_app/blueprint.ron | 50 + .../generated_app/src/lib.rs | 158 + .../tuples_are_supported/src}/lib.rs | 0 .../tuples_are_supported/src/main.rs | 24 + .../tuples_are_supported/test_config.toml | 0 .../type_alias_are_supported/Cargo.toml | 21 + .../type_alias_are_supported/diagnostics.dot | 51 + .../ephemeral_deps/dep/Cargo.toml | 14 + .../ephemeral_deps/dep/src/lib.rs} | 0 .../expectations/app.rs | 0 .../expectations/diagnostics.dot | 0 .../expectations/stderr.txt | 0 .../generated_app/Cargo.toml | 17 + .../generated_app/blueprint.ron | 70 + .../generated_app/src/lib.rs | 181 ++ .../type_alias_are_supported/src}/lib.rs | 0 .../type_alias_are_supported/src/main.rs | 24 + .../type_alias_are_supported/test_config.toml | 0 libs/ui_tests/workspace_hack/.gitattributes | 4 + libs/ui_tests/workspace_hack/Cargo.toml | 48 + libs/ui_tests/workspace_hack/build.rs | 2 + libs/ui_tests/workspace_hack/src/lib.rs | 1 + 1341 files changed, 41470 insertions(+), 241 deletions(-) create mode 100644 libs/ui_tests/.cargo/config.toml create mode 100644 libs/ui_tests/.config/hakari.toml create mode 100644 libs/ui_tests/Cargo.lock create mode 100644 libs/ui_tests/Cargo.toml create mode 100644 libs/ui_tests/app_builder/Cargo.toml create mode 100644 libs/ui_tests/app_builder/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/app_builder/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/app_builder/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/app_builder/generated_app/Cargo.toml create mode 100644 libs/ui_tests/app_builder/generated_app/blueprint.ron create mode 100644 libs/ui_tests/app_builder/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/app_builder => ui_tests/app_builder/src}/lib.rs (100%) create mode 100644 libs/ui_tests/app_builder/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/app_builder/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/common/async_callable_are_supported/Cargo.toml create mode 100644 libs/ui_tests/blueprint/common/async_callable_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/async_callable_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/async_callable_are_supported/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported => ui_tests/blueprint/common/async_callable_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/common/async_callable_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/async_callable_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/common/cannot_return_the_unit_type/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/cannot_return_the_unit_type/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/common/cannot_return_the_unit_type => ui_tests/blueprint/common/cannot_return_the_unit_type/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/common/cannot_return_the_unit_type/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/cannot_return_the_unit_type/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/common/cannot_take_mutable_references_as_input => ui_tests/blueprint/common/cannot_take_mutable_references_as_input/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/common/cloning_if_necessary_requires_clone => ui_tests/blueprint/common/cloning_if_necessary_requires_clone/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs => ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/common/components_can_fail/Cargo.toml create mode 100644 libs/ui_tests/blueprint/common/components_can_fail/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/components_can_fail/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/components_can_fail/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/common/components_can_fail/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/common/components_can_fail/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/common/components_can_fail => ui_tests/blueprint/common/components_can_fail/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/common/components_can_fail/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/components_can_fail/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/common/output_type_must_implement_into_response/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/output_type_must_implement_into_response/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/common/output_type_must_implement_into_response => ui_tests/blueprint/common/output_type_must_implement_into_response/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/common/output_type_must_implement_into_response/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/common/output_type_must_implement_into_response/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors => ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors => ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic => ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters => ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/.atomicwritevn0J69/tmpfile.tmp create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic => ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/static_references_are_valid_singletons/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/static_references_are_valid_singletons/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/static_references_are_valid_singletons => ui_tests/blueprint/constructors/static_references_are_valid_singletons/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/static_references_are_valid_singletons/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/diagnostics.dot create mode 100644 libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/ephemeral_deps/dep/Cargo.toml rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/dep.rs => ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/ephemeral_deps/dep/src/lib.rs} (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/app.rs (99%) create mode 100644 libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/diagnostics.dot create mode 100644 libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence => ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/src}/lib.rs (55%) create mode 100644 libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle => ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons => ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored => ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor => ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor => ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/Cargo.toml create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type => ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible => ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input => ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error => ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic => ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type => ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref => ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/Cargo.toml create mode 100644 libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes => ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/Cargo.toml create mode 100644 libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported => ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/nesting/nest_at_prefix_is_validated => ui_tests/blueprint/nesting/nest_at_prefix_is_validated/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden => ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes => ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp => ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs => ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/Cargo.toml create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern => ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input => ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/Cargo.toml create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping => ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic => ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/Cargo.toml create mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping => ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic => ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt => ui_tests/blueprint/prebuilts/invalid_prebuilt/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/invalid_prebuilt/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/Cargo.toml create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time => ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_works/Cargo.toml create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_works/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/prebuilt_works/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/prebuilt_works/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_works => ui_tests/blueprint/prebuilts/prebuilt_works/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_works/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/prebuilt_works/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/Cargo.toml create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned => ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/unused_prebuilt/Cargo.toml create mode 100644 libs/ui_tests/blueprint/prebuilts/unused_prebuilt/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/prebuilts/unused_prebuilt => ui_tests/blueprint/prebuilts/unused_prebuilt/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/prebuilts/unused_prebuilt/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/prebuilts/unused_prebuilt/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/router/ambiguous_fallback/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/ambiguous_fallback/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/router/ambiguous_fallback => ui_tests/blueprint/router/ambiguous_fallback/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/router/ambiguous_fallback/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/ambiguous_fallback/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/router/conflicting_any_and_single_method_guards => ui_tests/blueprint/router/conflicting_any_and_single_method_guards/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/router/different_fallback_for_each_method/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/different_fallback_for_each_method/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/router/different_fallback_for_each_method => ui_tests/blueprint/router/different_fallback_for_each_method/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/router/different_fallback_for_each_method/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/different_fallback_for_each_method/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/router/fallback_priority/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/fallback_priority/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/fallback_priority/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/fallback_priority/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/fallback_priority/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/fallback_priority/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/router/fallback_priority/generated_app/src/lib.rs create mode 100644 libs/ui_tests/blueprint/router/fallback_priority/integration/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/fallback_priority/integration/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/test.rs => ui_tests/blueprint/router/fallback_priority/integration/tests/run.rs} (100%) rename libs/{pavex_cli/tests/ui_tests/blueprint/router/fallback_priority => ui_tests/blueprint/router/fallback_priority/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/router/fallback_priority/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/fallback_priority/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/router/http_method_routing_variants/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/http_method_routing_variants/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/http_method_routing_variants/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/http_method_routing_variants/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/router/http_method_routing_variants => ui_tests/blueprint/router/http_method_routing_variants/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/router/http_method_routing_variants/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/http_method_routing_variants/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/router/invalid_paths/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/invalid_paths/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/router/invalid_paths/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/invalid_paths/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/router/invalid_paths/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/router/invalid_paths => ui_tests/blueprint/router/invalid_paths/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/router/invalid_paths/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/invalid_paths/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/request_handlers_can_take_mut_references/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/request_handlers_can_take_mut_references/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/router/request_handlers_can_take_mut_references => ui_tests/blueprint/router/request_handlers_can_take_mut_references/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/request_handlers_can_take_mut_references/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/router/route_path_is_validated/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/route_path_is_validated/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/router/route_path_is_validated => ui_tests/blueprint/router/route_path_is_validated/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/router/route_path_is_validated/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/route_path_is_validated/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers => ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs => ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input => ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter => ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/test_config.toml (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic => ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src}/lib.rs (100%) create mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut => ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut => ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_transients_as_mut => ui_tests/borrow_checker/cannot_borrow_transients_as_mut/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors => ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches => ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy => ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone => ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone => ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice => ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice => ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice => ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice => ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice => ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice => ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice => ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages => ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/mutability/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/mutability/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/mutability/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/mutability/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/mutability/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/mutability/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/mutability/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/mutability => ui_tests/borrow_checker/mutability/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/mutability/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/mutability/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/transitive_borrows/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/transitive_borrows/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/transitive_borrows/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/transitive_borrows/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/transitive_borrows/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/transitive_borrows/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/transitive_borrows/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows => ui_tests/borrow_checker/transitive_borrows/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/transitive_borrows/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/transitive_borrows/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable => ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable => ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable => ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy => ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable => ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable => ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable => ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/test_config.toml (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable => ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src}/lib.rs (100%) create mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/test_config.toml (100%) create mode 100644 libs/ui_tests/connection_info/connection_info_fallback_happy_path/Cargo.toml create mode 100644 libs/ui_tests/connection_info/connection_info_fallback_happy_path/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml create mode 100644 libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/blueprint.ron create mode 100644 libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/src/lib.rs create mode 100644 libs/ui_tests/connection_info/connection_info_fallback_happy_path/integration/Cargo.toml create mode 100644 libs/ui_tests/connection_info/connection_info_fallback_happy_path/integration/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/test.rs => ui_tests/connection_info/connection_info_fallback_happy_path/integration/tests/run.rs} (100%) rename libs/{pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path => ui_tests/connection_info/connection_info_fallback_happy_path/src}/lib.rs (100%) create mode 100644 libs/ui_tests/connection_info/connection_info_fallback_happy_path/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/connection_info/connection_info_fallback_happy_path/test_config.toml (100%) create mode 100644 libs/ui_tests/connection_info/connection_info_happy_path/Cargo.toml create mode 100644 libs/ui_tests/connection_info/connection_info_happy_path/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/connection_info/connection_info_happy_path/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/connection_info/connection_info_happy_path/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml create mode 100644 libs/ui_tests/connection_info/connection_info_happy_path/generated_app/blueprint.ron create mode 100644 libs/ui_tests/connection_info/connection_info_happy_path/generated_app/src/lib.rs create mode 100644 libs/ui_tests/connection_info/connection_info_happy_path/integration/Cargo.toml create mode 100644 libs/ui_tests/connection_info/connection_info_happy_path/integration/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path/test.rs => ui_tests/connection_info/connection_info_happy_path/integration/tests/run.rs} (100%) rename libs/{pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path => ui_tests/connection_info/connection_info_happy_path/src}/lib.rs (100%) create mode 100644 libs/ui_tests/connection_info/connection_info_happy_path/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/connection_info/connection_info_happy_path/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed => ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement => ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/cycles/request_scoped_cycles/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/cycles/request_scoped_cycles => ui_tests/dependency_injection/cycles/request_scoped_cycles/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/cycles/request_scoped_cycles/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/cycles/transient_cycles/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/cycles/transient_cycles/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/cycles/transient_cycles => ui_tests/dependency_injection/cycles/transient_cycles/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/cycles/transient_cycles/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/cycles/transient_cycles/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type => ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/elided_lifetimes_are_handled => ui_tests/dependency_injection/elided_lifetimes_are_handled/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/elided_lifetimes_are_handled/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons => ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped => ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters => ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/missing_handler_dependency/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/missing_handler_dependency/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/missing_handler_dependency => ui_tests/dependency_injection/missing_handler_dependency/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/missing_handler_dependency/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/missing_handler_dependency/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/missing_singleton_dependency/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/missing_singleton_dependency/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/missing_singleton_dependency => ui_tests/dependency_injection/missing_singleton_dependency/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/missing_singleton_dependency/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/missing_singleton_dependency/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/next_state_is_populated_correctly/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/next_state_is_populated_correctly/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly => ui_tests/dependency_injection/next_state_is_populated_correctly/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/next_state_is_populated_correctly/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/next_state_is_populated_correctly/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors => ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed => ui_tests/dependency_injection/references_to_constructible_types_are_allowed/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/test_config.toml (100%) create mode 100644 libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/some_types_cannot_be_constructed/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/Cargo.toml create mode 100644 libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/blueprint.ron create mode 100644 libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/dependency_injection/some_types_cannot_be_constructed => ui_tests/dependency_injection/some_types_cannot_be_constructed/src}/lib.rs (100%) create mode 100644 libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/dependency_injection/some_types_cannot_be_constructed/test_config.toml (100%) create mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/Cargo.toml create mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/blueprint.ron create mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors => ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src}/lib.rs (100%) create mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/test_config.toml (100%) create mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/Cargo.toml create mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/blueprint.ron create mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors => ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src}/lib.rs (100%) create mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/test_config.toml (100%) create mode 100644 libs/ui_tests/error_observers/error_observer_with_generic_error/Cargo.toml create mode 100644 libs/ui_tests/error_observers/error_observer_with_generic_error/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_with_generic_error/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_with_generic_error/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_with_generic_error/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml create mode 100644 libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/blueprint.ron create mode 100644 libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/error_observers/error_observer_with_generic_error => ui_tests/error_observers/error_observer_with_generic_error/src}/lib.rs (100%) create mode 100644 libs/ui_tests/error_observers/error_observer_with_generic_error/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observer_with_generic_error/test_config.toml (100%) create mode 100644 libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/Cargo.toml create mode 100644 libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml create mode 100644 libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/blueprint.ron create mode 100644 libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons => ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/src}/lib.rs (100%) create mode 100644 libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/test_config.toml (100%) create mode 100644 libs/ui_tests/error_observers/error_observers_happy_path/Cargo.toml create mode 100644 libs/ui_tests/error_observers/error_observers_happy_path/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observers_happy_path/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observers_happy_path/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observers_happy_path/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml create mode 100644 libs/ui_tests/error_observers/error_observers_happy_path/generated_app/blueprint.ron create mode 100644 libs/ui_tests/error_observers/error_observers_happy_path/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/error_observers/error_observers_happy_path => ui_tests/error_observers/error_observers_happy_path/src}/lib.rs (100%) create mode 100644 libs/ui_tests/error_observers/error_observers_happy_path/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/error_observers/error_observers_happy_path/test_config.toml (100%) create mode 100644 libs/ui_tests/generated_app/Cargo.toml create mode 100644 libs/ui_tests/generated_app/src/lib.rs create mode 100644 libs/ui_tests/middlewares/middlewares_execution_order/Cargo.toml create mode 100644 libs/ui_tests/middlewares/middlewares_execution_order/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/middlewares/middlewares_execution_order/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/middlewares/middlewares_execution_order/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml create mode 100644 libs/ui_tests/middlewares/middlewares_execution_order/generated_app/blueprint.ron create mode 100644 libs/ui_tests/middlewares/middlewares_execution_order/generated_app/src/lib.rs create mode 100644 libs/ui_tests/middlewares/middlewares_execution_order/integration/Cargo.toml create mode 100644 libs/ui_tests/middlewares/middlewares_execution_order/integration/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/test.rs => ui_tests/middlewares/middlewares_execution_order/integration/tests/run.rs} (100%) rename libs/{pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order => ui_tests/middlewares/middlewares_execution_order/src}/lib.rs (100%) create mode 100644 libs/ui_tests/middlewares/middlewares_execution_order/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/middlewares/middlewares_execution_order/test_config.toml (100%) create mode 100644 libs/ui_tests/middlewares/next_handles_lifetimes/Cargo.toml create mode 100644 libs/ui_tests/middlewares/next_handles_lifetimes/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/middlewares/next_handles_lifetimes/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/middlewares/next_handles_lifetimes/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml create mode 100644 libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/blueprint.ron create mode 100644 libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes => ui_tests/middlewares/next_handles_lifetimes/src}/lib.rs (100%) create mode 100644 libs/ui_tests/middlewares/next_handles_lifetimes/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/middlewares/next_handles_lifetimes/test_config.toml (100%) create mode 100644 libs/ui_tests/middlewares/next_handles_mut_references/Cargo.toml create mode 100644 libs/ui_tests/middlewares/next_handles_mut_references/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/middlewares/next_handles_mut_references/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/middlewares/next_handles_mut_references/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml create mode 100644 libs/ui_tests/middlewares/next_handles_mut_references/generated_app/blueprint.ron create mode 100644 libs/ui_tests/middlewares/next_handles_mut_references/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/middlewares/next_handles_mut_references => ui_tests/middlewares/next_handles_mut_references/src}/lib.rs (100%) create mode 100644 libs/ui_tests/middlewares/next_handles_mut_references/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/middlewares/next_handles_mut_references/test_config.toml (100%) create mode 100644 libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/Cargo.toml create mode 100644 libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml create mode 100644 libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/blueprint.ron create mode 100644 libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares => ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src}/lib.rs (100%) create mode 100644 libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/test_config.toml (100%) create mode 100644 libs/ui_tests/path_parameters/path_parameters_happy_path/Cargo.toml create mode 100644 libs/ui_tests/path_parameters/path_parameters_happy_path/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/path_parameters/path_parameters_happy_path/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/path_parameters/path_parameters_happy_path/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml create mode 100644 libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/blueprint.ron create mode 100644 libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/src/lib.rs create mode 100644 libs/ui_tests/path_parameters/path_parameters_happy_path/integration/Cargo.toml create mode 100644 libs/ui_tests/path_parameters/path_parameters_happy_path/integration/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path/test.rs => ui_tests/path_parameters/path_parameters_happy_path/integration/tests/run.rs} (100%) rename libs/{pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path => ui_tests/path_parameters/path_parameters_happy_path/src}/lib.rs (100%) create mode 100644 libs/ui_tests/path_parameters/path_parameters_happy_path/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/path_parameters/path_parameters_happy_path/test_config.toml (100%) create mode 100644 libs/ui_tests/path_parameters/path_parameters_non_existing_fields/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/path_parameters/path_parameters_non_existing_fields/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/Cargo.toml create mode 100644 libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/blueprint.ron create mode 100644 libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/path_parameters/path_parameters_non_existing_fields => ui_tests/path_parameters/path_parameters_non_existing_fields/src}/lib.rs (100%) create mode 100644 libs/ui_tests/path_parameters/path_parameters_non_existing_fields/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/path_parameters/path_parameters_non_existing_fields/test_config.toml (100%) create mode 100644 libs/ui_tests/path_parameters/path_parameters_unsupported_types/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/path_parameters/path_parameters_unsupported_types/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/Cargo.toml create mode 100644 libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/blueprint.ron create mode 100644 libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/path_parameters/path_parameters_unsupported_types => ui_tests/path_parameters/path_parameters_unsupported_types/src}/lib.rs (100%) create mode 100644 libs/ui_tests/path_parameters/path_parameters_unsupported_types/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/path_parameters/path_parameters_unsupported_types/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/a_fix_is_suggested_for_function_invocations => ui_tests/reflection/a_fix_is_suggested_for_function_invocations/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/Cargo.toml create mode 100644 libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/ambiguous_dependency_version_is_handled/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/ambiguous_dependency_version_is_handled/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/ambiguous_dependency_version_is_handled => ui_tests/reflection/ambiguous_dependency_version_is_handled/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/ambiguous_dependency_version_is_handled/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/arc_singletons_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/arc_singletons_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/arc_singletons_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/arc_singletons_are_supported/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported => ui_tests/reflection/arc_singletons_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/arc_singletons_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/arc_singletons_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/common_response_types_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/common_response_types_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/common_response_types_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/common_response_types_are_supported/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/common_response_types_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/common_response_types_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/common_response_types_are_supported => ui_tests/reflection/common_response_types_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/common_response_types_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/common_response_types_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/Cargo.toml rename libs/{pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations => ui_tests/reflection/crate_resolution/dependencies_can_register_local_items}/diagnostics.dot (91%) create mode 100644 libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/ephemeral_deps/dep/Cargo.toml rename libs/{pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/dep.rs => ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/ephemeral_deps/dep/src/lib.rs} (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items => ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported => ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/Cargo.toml create mode 100644 libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/ephemeral_deps/dep/Cargo.toml rename libs/{pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/dep.rs => ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/ephemeral_deps/dep/src/lib.rs} (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute => ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/Cargo.toml create mode 100644 libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_1/Cargo.toml create mode 100644 libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_1/src/lib.rs create mode 100644 libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_2/Cargo.toml create mode 100644 libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_2/src/lib.rs create mode 100644 libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/src/lib.rs create mode 100644 libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/src/lib.rs create mode 100644 libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/src/main.rs create mode 100644 libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/Cargo.toml create mode 100644 libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/diagnostics.dot create mode 100644 libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/Cargo.toml rename libs/{pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/dep.rs => ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/src/lib.rs} (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed => ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/generic_handlers_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/generic_handlers_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/generic_handlers_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/generic_handlers_are_supported/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/generic_handlers_are_supported/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/generic_handlers_are_supported => ui_tests/reflection/generic_handlers_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/generic_handlers_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/generic_handlers_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/Cargo.toml create mode 100644 libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/diagnostics.dot create mode 100644 libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/ephemeral_deps/dep_1/Cargo.toml rename libs/{pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/dep_1.rs => ui_tests/reflection/generic_parameters_can_come_from_another_crate/ephemeral_deps/dep_1/src/lib.rs} (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate => ui_tests/reflection/generic_parameters_can_come_from_another_crate/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/generic_parameters_can_come_from_another_crate/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/invalid_callable_path/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/reflection/invalid_callable_path/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/invalid_callable_path/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/invalid_callable_path/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/invalid_callable_path/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/invalid_callable_path => ui_tests/reflection/invalid_callable_path/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/invalid_callable_path/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/invalid_callable_path/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/lifetime_restrictions_are_handled/Cargo.toml create mode 100644 libs/ui_tests/reflection/lifetime_restrictions_are_handled/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/lifetime_restrictions_are_handled/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/lifetime_restrictions_are_handled/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/lifetime_restrictions_are_handled => ui_tests/reflection/lifetime_restrictions_are_handled/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/lifetime_restrictions_are_handled/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/lifetime_restrictions_are_handled/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate => ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/local_glob_reexports_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/local_glob_reexports_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/local_glob_reexports_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/local_glob_reexports_are_supported/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/local_glob_reexports_are_supported => ui_tests/reflection/local_glob_reexports_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/local_glob_reexports_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/local_glob_reexports_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/non_static_methods_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/non_static_methods_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/non_static_methods_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/non_static_methods_are_supported/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/non_static_methods_are_supported/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported => ui_tests/reflection/non_static_methods_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/non_static_methods_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/non_static_methods_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/output_parameter_cannot_be_handled/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/reflection/output_parameter_cannot_be_handled/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/output_parameter_cannot_be_handled => ui_tests/reflection/output_parameter_cannot_be_handled/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/output_parameter_cannot_be_handled/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/output_parameter_cannot_be_handled/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported => ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/reexported_type_alias_work/Cargo.toml create mode 100644 libs/ui_tests/reflection/reexported_type_alias_work/diagnostics.dot create mode 100644 libs/ui_tests/reflection/reexported_type_alias_work/ephemeral_deps/dep/Cargo.toml rename libs/{pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/dep.rs => ui_tests/reflection/reexported_type_alias_work/ephemeral_deps/dep/src/lib.rs} (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/reexported_type_alias_work/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/reexported_type_alias_work/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/reexported_type_alias_work/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/reexported_type_alias_work/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work => ui_tests/reflection/reexported_type_alias_work/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/reexported_type_alias_work/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/reexported_type_alias_work/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported => ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported => ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/self_as_generic_parameter_is_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/self_as_generic_parameter_is_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/self_as_generic_parameter_is_supported => ui_tests/reflection/self_as_generic_parameter_is_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/self_as_generic_parameter_is_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/self_as_generic_parameter_is_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/static_methods_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/static_methods_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/static_methods_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/static_methods_are_supported/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/static_methods_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/static_methods_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/static_methods_are_supported => ui_tests/reflection/static_methods_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/static_methods_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/static_methods_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/Cargo.toml rename libs/{pavex_cli/tests => }/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute => ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/trait_methods_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/trait_methods_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/trait_methods_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/trait_methods_are_supported/expectations/diagnostics.dot (100%) create mode 100644 libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/trait_methods_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/trait_methods_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported => ui_tests/reflection/trait_methods_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/trait_methods_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/trait_methods_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported => ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/tuples_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/tuples_are_supported/diagnostics.dot rename libs/{pavex_cli/tests => }/ui_tests/reflection/tuples_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/tuples_are_supported/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/tuples_are_supported/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/tuples_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/tuples_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/tuples_are_supported => ui_tests/reflection/tuples_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/tuples_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/tuples_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/reflection/type_alias_are_supported/Cargo.toml create mode 100644 libs/ui_tests/reflection/type_alias_are_supported/diagnostics.dot create mode 100644 libs/ui_tests/reflection/type_alias_are_supported/ephemeral_deps/dep/Cargo.toml rename libs/{pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/dep.rs => ui_tests/reflection/type_alias_are_supported/ephemeral_deps/dep/src/lib.rs} (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/type_alias_are_supported/expectations/app.rs (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/type_alias_are_supported/expectations/diagnostics.dot (100%) rename libs/{pavex_cli/tests => }/ui_tests/reflection/type_alias_are_supported/expectations/stderr.txt (100%) create mode 100644 libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml create mode 100644 libs/ui_tests/reflection/type_alias_are_supported/generated_app/blueprint.ron create mode 100644 libs/ui_tests/reflection/type_alias_are_supported/generated_app/src/lib.rs rename libs/{pavex_cli/tests/ui_tests/reflection/type_alias_are_supported => ui_tests/reflection/type_alias_are_supported/src}/lib.rs (100%) create mode 100644 libs/ui_tests/reflection/type_alias_are_supported/src/main.rs rename libs/{pavex_cli/tests => }/ui_tests/reflection/type_alias_are_supported/test_config.toml (100%) create mode 100644 libs/ui_tests/workspace_hack/.gitattributes create mode 100644 libs/ui_tests/workspace_hack/Cargo.toml create mode 100644 libs/ui_tests/workspace_hack/build.rs create mode 100644 libs/ui_tests/workspace_hack/src/lib.rs diff --git a/.gitignore b/.gitignore index 4a2e78f58..28f51945b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -/libs/ui_test_envs -/libs/ui_test_envs2 +/libs/ui_tests/target /libs/target /libs/vendor /doc_examples/tutorial_envs/ diff --git a/libs/pavex_cli/tests/ui_tests.rs b/libs/pavex_cli/tests/ui_tests.rs index 1e4694f84..04e84b94b 100644 --- a/libs/pavex_cli/tests/ui_tests.rs +++ b/libs/pavex_cli/tests/ui_tests.rs @@ -4,17 +4,10 @@ use std::str::FromStr; fn main() -> Result<(), Box> { let manifest_dir = PathBuf::from_str(env!("CARGO_MANIFEST_DIR")).unwrap(); - let test_data_folder = manifest_dir.join("tests").join("ui_tests"); - let test_runtime_folder = manifest_dir.parent().unwrap().join("ui_test_envs2"); - let pavex_cli_path = get_pavex_cli_path()?; + let test_runtime_folder = manifest_dir.parent().unwrap().join("ui_tests"); let pavexc_cli_path = get_pavexc_cli_path()?; - run_tests( - pavex_cli_path, - pavexc_cli_path, - test_data_folder, - test_runtime_folder, - )? - .exit(); + let pavex_cli_path = get_pavex_cli_path()?; + run_tests(pavex_cli_path, pavexc_cli_path, test_runtime_folder)?.exit(); } fn get_pavex_cli_path() -> Result> { diff --git a/libs/pavex_test_runner/Cargo.toml b/libs/pavex_test_runner/Cargo.toml index e6e2a8eed..ee40cc96f 100644 --- a/libs/pavex_test_runner/Cargo.toml +++ b/libs/pavex_test_runner/Cargo.toml @@ -11,6 +11,10 @@ publish = false [package.metadata.dist] dist = false +[[bin]] +path = "src/main.rs" +name = "snaps" + [dependencies] anyhow = { workspace = true } ahash = { workspace = true } diff --git a/libs/pavex_test_runner/src/lib.rs b/libs/pavex_test_runner/src/lib.rs index 153f135b4..d8e80b518 100644 --- a/libs/pavex_test_runner/src/lib.rs +++ b/libs/pavex_test_runner/src/lib.rs @@ -16,7 +16,7 @@ use sha2::Digest; use toml::toml; use walkdir::WalkDir; -use persist_if_changed::{copy_if_changed, persist_if_changed}; +use persist_if_changed::persist_if_changed; pub use snapshot::print_changeset; use crate::snapshot::SnapshotTest; @@ -60,32 +60,26 @@ pub fn get_test_name(tests_parent_folder: &Path, test_folder: &Path) -> String { pub fn run_tests( pavex_cli: PathBuf, pavexc_cli: PathBuf, - definition_directory: PathBuf, - runtime_directory: PathBuf, + tests_directory: PathBuf, ) -> Result { let arguments = libtest_mimic::Arguments::from_args(); let mut test_name2test_data = BTreeMap::new(); - for entry in get_ui_test_directories(&definition_directory) { - let test_name = get_test_name(&definition_directory, &entry); - let relative_path = entry.strip_prefix(&definition_directory).unwrap(); - let test_data = TestData::new( - &test_name, - entry.clone(), - runtime_directory.join(relative_path), - )?; + for entry in get_ui_test_directories(&tests_directory) { + let test_name = get_test_name(&tests_directory, &entry); + let test_data = TestData::new(&test_name, entry.clone())?; if is_filtered_out(&arguments, &test_name) || test_data.configuration.ignore { continue; } test_name2test_data.insert(test_name, test_data); } - create_tests_dir(&runtime_directory, &test_name2test_data, &pavex_cli)?; + create_tests_dir(&tests_directory, &test_name2test_data)?; let mut trials = Vec::with_capacity(test_name2test_data.len() * 4); if !arguments.list { - warm_up_rustdoc_cache(&runtime_directory, &test_name2test_data)?; - warm_up_target_dir(&runtime_directory, &test_name2test_data)?; + warm_up_rustdoc_cache(&tests_directory, &test_name2test_data)?; + warm_up_target_dir(&tests_directory, &test_name2test_data)?; // First battery of the UI tests. // For each UI test, we run code generation and then generate a different @@ -100,7 +94,7 @@ pub fn run_tests( .map(|(name, data)| { let mut trials = Vec::new(); let (codegen_output, outcome) = - code_generation_test(&runtime_directory, &data, &pavexc_cli); + code_generation_test(&tests_directory, &data, &pavexc_cli, &pavex_cli); let is_success = outcome == CodegenTestOutcome::Success; let trial = outcome.into_trial(&name, &data.configuration, codegen_output.as_ref()); trials.push(trial); @@ -144,7 +138,7 @@ pub fn run_tests( }); let (cases, test_name2test_data) = - compile_generated_apps(&runtime_directory, test_name2test_data)?; + compile_generated_apps(&tests_directory, test_name2test_data)?; trials.extend(cases); @@ -411,7 +405,6 @@ fn warm_up_rustdoc_cache( fn create_tests_dir( runtime_directory: &Path, test_name2test_data: &BTreeMap, - pavex_cli: &Path, ) -> Result<(), anyhow::Error> { let timer = std::time::Instant::now(); println!("Seeding the filesystem"); @@ -453,7 +446,7 @@ fn create_tests_dir( // everything under a test-specific directory to avoid name // clashes and confusion across tests for test_data in test_name2test_data.values() { - test_data.seed_test_filesystem(pavex_cli)?; + test_data.reset_test_filesystem()?; } println!( @@ -552,17 +545,12 @@ impl ExpectedOutcome { struct TestData { name_hash: String, definition_directory: PathBuf, - runtime_directory: PathBuf, configuration: TestConfig, has_tests: bool, } impl TestData { - fn new( - test_name: &str, - definition_directory: PathBuf, - runtime_directory: PathBuf, - ) -> Result { + fn new(test_name: &str, definition_directory: PathBuf) -> Result { let name_hash = { let mut hasher = sha2::Sha256::default(); <_ as sha2::Digest>::update(&mut hasher, test_name.as_bytes()); @@ -575,13 +563,12 @@ impl TestData { hash }; let configuration = Self::load_configuration(&definition_directory)?; - let integration_test_file = definition_directory.join("test.rs"); + let integration_test_file = definition_directory.join("integration"); let has_tests = integration_test_file.exists(); Ok(Self { name_hash, definition_directory, configuration, - runtime_directory, has_tests, }) } @@ -617,12 +604,12 @@ impl TestData { /// We don't want to list ephemeral dependencies as members of the workspace of the project under test /// in order to be able to have multiple versions of the same crate as dependencies of the project under test. /// That would be forbidden by `cargo` if they were listed as members of the same workspace. - fn ephemeral_deps_runtime_directory(&self) -> PathBuf { - self.runtime_directory.join("ephemeral_deps") + fn ephemeral_deps_directory(&self) -> PathBuf { + self.definition_directory.join("ephemeral_deps") } fn blueprint_directory(&self) -> &Path { - &self.runtime_directory + &self.definition_directory } fn expectations_directory(&self) -> PathBuf { @@ -630,7 +617,7 @@ impl TestData { } fn generated_app_directory(&self) -> PathBuf { - self.runtime_directory.join("generated_app") + self.definition_directory.join("generated_app") } fn blueprint_crate_name(&self) -> String { @@ -643,130 +630,11 @@ impl TestData { fn integration_test_directory(&self) -> Option { self.has_tests - .then(|| self.runtime_directory.join("integration")) + .then(|| self.definition_directory.join("integration")) } - /// Populate the runtime test folder using the directives and the files in the test - /// definition folder. - fn seed_test_filesystem(&self, pavex_cli: &Path) -> Result<(), anyhow::Error> { - fs_err::create_dir_all(&self.runtime_directory) - .context("Failed to create runtime directory for UI test")?; - let source_directory = self.runtime_directory.join("src"); - fs_err::create_dir_all(&source_directory).context( - "Failed to create the runtime directory for the project under test when setting up the test runtime environment", - )?; - copy_if_changed( - &self.definition_directory.join("lib.rs"), - &source_directory.join("lib.rs"), - )?; - - let deps_subdir = self.ephemeral_deps_runtime_directory(); - fs_err::create_dir_all(&source_directory).context( - "Failed to create the runtime directory for ephemeral dependencies when setting up the test runtime environment", - )?; - - for (dependency_name, dependency_config) in &self.configuration.ephemeral_dependencies { - let dep_runtime_directory = deps_subdir.join(dependency_name); - let package_name = dependency_config - .package - .clone() - .unwrap_or(dependency_name.to_owned()); - let dep_source_directory = dep_runtime_directory.join("src"); - fs_err::create_dir_all(&dep_source_directory).context( - "Failed to create the source directory for an ephemeral dependency when setting up the test runtime environment", - )?; - - copy_if_changed( - &self.definition_directory.join(&dependency_config.path), - &dep_source_directory.join("lib.rs"), - )?; - - let mut cargo_toml = toml! { - [package] - name = "dummy" - version = "0.1.0" - edition = "2021" - - [lints.rust] - unexpected_cfgs = { level = "allow", check-cfg = ["cfg(pavex_ide_hint)"] } - unused = { level = "allow" } - - [dependencies] - pavex = { workspace = true } - }; - cargo_toml["package"]["name"] = format!("{package_name}_{}", self.name_hash).into(); - cargo_toml["package"]["version"] = dependency_config.version.clone().into(); - let deps = cargo_toml - .get_mut("dependencies") - .unwrap() - .as_table_mut() - .unwrap(); - deps.extend(dependency_config.dependencies.clone()); - - persist_if_changed( - &dep_runtime_directory.join("Cargo.toml"), - toml::to_string(&cargo_toml)?.as_bytes(), - )?; - } - - if let Some(integration_test_directory) = self.integration_test_directory() { - let integration_test_file = self.definition_directory.join("test.rs"); - let integration_test_src_directory = integration_test_directory.join("src"); - let integration_test_test_directory = integration_test_directory.join("tests"); - fs_err::create_dir_all(&integration_test_src_directory).context( - "Failed to create the runtime directory for integration tests when setting up the test runtime environment", - )?; - fs_err::create_dir_all(&integration_test_test_directory).context( - "Failed to create the runtime directory for integration tests when setting up the test runtime environment", - )?; - copy_if_changed( - &integration_test_file, - &integration_test_test_directory.join("run.rs"), - )?; - persist_if_changed(&integration_test_src_directory.join("lib.rs"), b"")?; - - let mut cargo_toml = toml! { - [package] - name = "dummy" - version = "0.1.0" - edition = "2021" - - [dependencies] - application = { path = "../generated_app" } - app = { path = ".." } - - [dev-dependencies] - tokio = { workspace = true, features = ["full"] } - reqwest = { workspace = true } - pavex = { workspace = true } - }; - cargo_toml["package"]["name"] = format!("integration_{}", self.name_hash).into(); - cargo_toml["dependencies"]["application"] - .as_table_mut() - .unwrap() - .insert( - "package".into(), - format!("application_{}", self.name_hash).into(), - ); - cargo_toml["dependencies"]["app"] - .as_table_mut() - .unwrap() - .insert("package".into(), format!("app_{}", self.name_hash).into()); - - let dev_deps = cargo_toml - .get_mut("dev-dependencies") - .unwrap() - .as_table_mut() - .unwrap(); - dev_deps.extend(self.configuration.dev_dependencies.clone()); - - persist_if_changed( - &integration_test_directory.join("Cargo.toml"), - toml::to_string(&cargo_toml)?.as_bytes(), - )?; - } - - // Generated application crate, ahead of code generation. + fn reset_test_filesystem(&self) -> Result<(), anyhow::Error> { + // Empty application crate, ahead of code generation. { let application_dir = self.generated_app_directory(); let application_src_dir = application_dir.join("src"); @@ -792,73 +660,22 @@ impl TestData { )?; } - let mut cargo_toml = toml! { - [package] - name = "dummy" - version = "0.1.0" - edition = "2021" - - [lints.rust] - unexpected_cfgs = { level = "allow", check-cfg = ["cfg(pavex_ide_hint)"] } - - [dependencies] - pavex = { workspace = true } - pavex_cli_client = { workspace = true } - workspace_hack = { workspace = true } - }; - cargo_toml["package"]["name"] = format!("app_{}", self.name_hash).into(); - let deps = cargo_toml - .get_mut("dependencies") - .unwrap() - .as_table_mut() - .unwrap(); - deps.extend(self.configuration.dependencies.clone()); - let ephemeral_dependencies = - self.configuration - .ephemeral_dependencies - .iter() - .map(|(key, config)| { - let mut value = toml::value::Table::new(); - value.insert("path".into(), format!("ephemeral_deps/{key}").into()); - let package_name = if let Some(package_name) = config.package.as_ref() { - package_name.to_owned() - } else { - key.to_owned() - }; - value.insert( - "package".into(), - format!("{package_name}_{}", self.name_hash).into(), - ); - (key.to_owned(), toml::Value::Table(value)) - }); - deps.extend(ephemeral_dependencies); - - persist_if_changed( - &self.runtime_directory.join("Cargo.toml"), - toml::to_string(&cargo_toml)?.as_bytes(), - )?; - - let cargo_config = toml! { - [build] - incremental = false - }; - let dot_cargo_folder = self.runtime_directory.join(".cargo"); - fs_err::create_dir_all(&dot_cargo_folder)?; - persist_if_changed( - &dot_cargo_folder.join("config.toml"), - toml::to_string(&cargo_config)?.as_bytes(), - )?; - - let main_rs = format!( - r##"use app_{}::blueprint; + // We manage here the code generator binary for each UI test + // to avoid code drifting + { + let main_rs = format!( + r##"//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_{}::blueprint; use pavex_cli_client::{{Client, config::Color}}; use pavex_cli_client::commands::generate::GenerateError; fn main() -> Result<(), Box> {{ + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); let outcome = Client::new() .color(Color::Always) - .pavex_cli_path(r#"{}"#.into()) - .generate(blueprint(), "{}".into()) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) .diagnostics_path("diagnostics.dot".into()) .execute(); match outcome {{ @@ -872,11 +689,13 @@ fn main() -> Result<(), Box> {{ Ok(()) }} "##, - self.name_hash, - pavex_cli.to_str().unwrap(), - self.runtime_directory.join("generated_app").display(), - ); - persist_if_changed(&source_directory.join("main.rs"), main_rs.as_bytes())?; + self.name_hash + ); + persist_if_changed( + &self.blueprint_directory().join("src").join("main.rs"), + main_rs.as_bytes(), + )?; + } Ok(()) } @@ -918,6 +737,7 @@ fn code_generation_test( runtime_directory: &Path, test: &TestData, pavexc_cli: &Path, + pavex_cli: &Path, ) -> (Option, CodegenTestOutcome) { let binary_name = format!("app_{}", test.name_hash); let binary = runtime_directory @@ -925,8 +745,10 @@ fn code_generation_test( .join("debug") .join(&binary_name); let output = match std::process::Command::new(binary) + .env("PAVEX_TEST_CLI_PATH", pavex_cli) + .env("UI_TEST_DIR", &test.definition_directory) .env("PAVEX_PAVEXC", pavexc_cli) - .current_dir(&test.runtime_directory) + .current_dir(&test.definition_directory) .output() { Ok(o) => o, @@ -1018,7 +840,7 @@ fn code_generation_diagnostics_test(test_name: &str, test: &TestData) -> Trial { test.blueprint_crate_name(), ); let actual_diagnostics = - match fs_err::read_to_string(test.runtime_directory.join("diagnostics.dot")) { + match fs_err::read_to_string(test.definition_directory.join("diagnostics.dot")) { Ok(d) => d, Err(e) => { let msg = format!( @@ -1071,7 +893,7 @@ fn application_integration_test(test: &TestData) -> Result<(), anyhow::Error> { // .arg("1") .arg("-p") .arg(format!("integration_{}", test.name_hash)) - .current_dir(&test.runtime_directory) + .current_dir(&test.definition_directory) .stdout(std::process::Stdio::inherit()) .stderr(std::process::Stdio::inherit()) .output() diff --git a/libs/pavex_test_runner/src/main.rs b/libs/pavex_test_runner/src/main.rs index 71a74317d..31f5873c1 100644 --- a/libs/pavex_test_runner/src/main.rs +++ b/libs/pavex_test_runner/src/main.rs @@ -15,7 +15,7 @@ fn main() -> Result<(), Box> { init_telemetry() } - let test_folder = workspace_root()?.join("pavex_cli/tests/ui_tests"); + let test_folder = workspace_root()?.join("ui_tests"); let terminal = console::Term::stdout(); for ui_test_dir in get_ui_test_directories(&test_folder) { assert!(ui_test_dir.as_path().metadata()?.is_dir()); diff --git a/libs/ui_tests/.cargo/config.toml b/libs/ui_tests/.cargo/config.toml new file mode 100644 index 000000000..c744cc753 --- /dev/null +++ b/libs/ui_tests/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +incremental = false diff --git a/libs/ui_tests/.config/hakari.toml b/libs/ui_tests/.config/hakari.toml new file mode 100644 index 000000000..8dc80e7d6 --- /dev/null +++ b/libs/ui_tests/.config/hakari.toml @@ -0,0 +1,25 @@ +# This file contains settings for `cargo hakari`. +# See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options. + +hakari-package = "workspace_hack" + +# Format version for hakari's output. Version 4 requires cargo-hakari 0.9.22 or above. +dep-format-version = "4" + +# Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended. +# Hakari works much better with the new feature resolver. +# For more about the new feature resolver, see: +# https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver +resolver = "2" + +# Add triples corresponding to platforms commonly used by developers here. +# https://doc.rust-lang.org/rustc/platform-support.html +platforms = [ + # "x86_64-unknown-linux-gnu", + # "x86_64-apple-darwin", + # "aarch64-apple-darwin", + # "x86_64-pc-windows-msvc", +] + +# Write out exact versions rather than a semver range. (Defaults to false.) +# exact-versions = true diff --git a/libs/ui_tests/Cargo.lock b/libs/ui_tests/Cargo.lock new file mode 100644 index 000000000..6522dd83e --- /dev/null +++ b/libs/ui_tests/Cargo.lock @@ -0,0 +1,2600 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm-siv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae0784134ba9375416d469ec31e7c5f9fa94405049cf08c5ce5b4698be673e0d" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "polyval", + "subtle", + "zeroize", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" + +[[package]] +name = "app_55dca802" +version = "0.1.0" +dependencies = [ + "dep_55dca802", + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "application_55dca802" +version = "0.1.0" +dependencies = [ + "app_55dca802", + "dep_55dca802", + "http", + "hyper", + "pavex", + "pavex_matchit", + "thiserror", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "backtrace-ext" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537beee3be4a18fb023b570f80e3ae28003db9167a751266b259926e25539d50" +dependencies = [ + "backtrace", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "biscotti" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0b3298a722061d404d4f0efb3d9dc2d16601649e6032165696e9c7b25f11d41" +dependencies = [ + "aes-gcm-siv", + "anyhow", + "base64 0.22.1", + "hkdf", + "hmac", + "percent-encoding", + "rand", + "serde", + "sha2", + "subtle", + "time", +] + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +dependencies = [ + "serde", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" + +[[package]] +name = "cc" +version = "1.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clap" +version = "4.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "rand_core", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "dep_55dca802" +version = "0.1.0" +dependencies = [ + "pavex", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fastrand" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" + +[[package]] +name = "h2" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +dependencies = [ + "equivalent", + "hashbrown", + "serde", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "ipnet" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "miette" +version = "7.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +dependencies = [ + "backtrace", + "backtrace-ext", + "cfg-if", + "miette-derive", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "7.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi", + "libc", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + +[[package]] +name = "object" +version = "0.36.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl" +version = "0.10.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "owo-colors" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pavex" +version = "0.1.48" +dependencies = [ + "anyhow", + "biscotti", + "bytes", + "fs-err", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "indexmap", + "mime", + "paste", + "pavex_bp_schema", + "pavex_macros", + "pavex_matchit", + "pavex_reflection", + "percent-encoding", + "persist_if_changed", + "pin-project-lite", + "px_workspace_hack", + "ron", + "serde", + "serde_html_form", + "serde_json", + "serde_path_to_error", + "smallvec", + "socket2", + "thiserror", + "time", + "tokio", + "tracing", + "type-safe-id", + "ubyte", + "uuid", +] + +[[package]] +name = "pavex_bp_schema" +version = "0.1.48" +dependencies = [ + "pavex_reflection", + "px_workspace_hack", + "serde", +] + +[[package]] +name = "pavex_cli_client" +version = "0.1.48" +dependencies = [ + "anyhow", + "pavex", + "px_workspace_hack", + "thiserror", +] + +[[package]] +name = "pavex_macros" +version = "0.1.48" +dependencies = [ + "proc-macro2", + "px_workspace_hack", + "quote", + "syn", +] + +[[package]] +name = "pavex_matchit" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77b9753b03381fd8856966146c4d626d9a8507901c1bcdfbc41df03deea551fc" + +[[package]] +name = "pavex_reflection" +version = "0.1.48" +dependencies = [ + "px_workspace_hack", + "serde", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "persist_if_changed" +version = "0.1.48" +dependencies = [ + "anyhow", + "fs-err", + "px_workspace_hack", + "sha2", + "tracing", +] + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "px_workspace_hack" +version = "0.1.0" +dependencies = [ + "ahash", + "aho-corasick", + "bitflags", + "byteorder", + "cc", + "clap", + "clap_builder", + "console", + "crossbeam-utils", + "crypto-common", + "deranged", + "digest", + "fixedbitset", + "futures-channel", + "futures-core", + "futures-sink", + "futures-util", + "getrandom", + "hashbrown", + "hmac", + "indexmap", + "log", + "memchr", + "miette", + "num-traits", + "petgraph", + "proc-macro2", + "quote", + "regex", + "regex-automata", + "regex-syntax", + "reqwest", + "serde", + "serde_json", + "sha2", + "smallvec", + "subtle", + "syn", + "time", + "time-macros", + "tokio", + "toml", + "toml_edit", + "tracing", + "tracing-core", + "tracing-log", + "uuid", + "zerocopy", + "zeroize", +] + +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "reqwest" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pemfile", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "windows-registry", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "ron" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +dependencies = [ + "base64 0.21.7", + "bitflags", + "serde", + "serde_derive", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + +[[package]] +name = "rustix" +version = "0.38.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.23.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schannel" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_html_form" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de514ef58196f1fc96dcaef80fe6170a1ce6215df9687a93fe8300e773fefc5" +dependencies = [ + "form_urlencoded", + "indexmap", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_json" +version = "1.0.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "supports-color" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8775305acf21c96926c900ad056abeef436701108518cf890020387236ac5a77" +dependencies = [ + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c0a1e5168041f5f3ff68ff7d95dcb9c8749df29f6e7e89ada40dd4c9de404ee" + +[[package]] +name = "supports-unicode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "type-safe-id" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2145079685621738e4e02fef4d5882d64498e8fcc90c8eee8dfcb9e62317ae2" +dependencies = [ + "arrayvec", + "rand", + "thiserror", + "uuid", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "ubyte" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" +dependencies = [ + "serde", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +dependencies = [ + "getrandom", + "rand", + "serde", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" + +[[package]] +name = "web-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.26.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + +[[package]] +name = "workspace_hack" +version = "0.1.0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "futures-task", + "futures-util", + "memchr", + "proc-macro2", + "quote", + "reqwest", + "serde", + "serde_json", + "smallvec", + "syn", + "tokio", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/libs/ui_tests/Cargo.toml b/libs/ui_tests/Cargo.toml new file mode 100644 index 000000000..85053ce8e --- /dev/null +++ b/libs/ui_tests/Cargo.toml @@ -0,0 +1,12 @@ +[workspace] +members = [ + "blueprint/constructors/the_latest_registered_constructor_takes_precedence", + "blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app", +] +resolver = "2" +[workspace.dependencies] +pavex = { path = "../pavex" } +pavex_cli_client = { path = "../pavex_cli_client" } +workspace_hack = { path = "workspace_hack" } +tokio = "1" +reqwest = "0.12" diff --git a/libs/ui_tests/app_builder/Cargo.toml b/libs/ui_tests/app_builder/Cargo.toml new file mode 100644 index 000000000..8a4f32020 --- /dev/null +++ b/libs/ui_tests/app_builder/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_f10df8fa" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/app_builder/diagnostics.dot b/libs/ui_tests/app_builder/diagnostics.dot new file mode 100644 index 000000000..d2bec66dc --- /dev/null +++ b/libs/ui_tests/app_builder/diagnostics.dot @@ -0,0 +1,67 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0(app_f10df8fa::HttpClient, pavex::request::RequestHead) -> crate::route_0::Next0"] + 3 [ label = "app_f10df8fa::HttpClient"] + 4 [ label = "pavex::request::RequestHead"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 4 -> 2 [ ] + 3 -> 2 [ ] + 0 -> 5 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_f10df8fa::stream_file(std::path::PathBuf, app_f10df8fa::Logger, app_f10df8fa::HttpClient) -> pavex::response::Response"] + 1 [ label = "core::prelude::rust_2015::Result> -> std::path::PathBuf"] + 2 [ label = "app_f10df8fa::logger() -> app_f10df8fa::Logger"] + 3 [ label = "app_f10df8fa::HttpClient"] + 4 [ label = "app_f10df8fa::extract_path(pavex::request::RequestHead) -> core::prelude::rust_2015::Result>"] + 5 [ label = "pavex::request::RequestHead"] + 6 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 7 [ label = "core::prelude::rust_2015::Result> -> app_f10df8fa::ExtractPathError"] + 8 [ label = "app_f10df8fa::handle_extract_path_error(&app_f10df8fa::ExtractPathError, app_f10df8fa::Logger) -> pavex::response::Response"] + 9 [ label = "app_f10df8fa::logger() -> app_f10df8fa::Logger"] + 10 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 11 [ label = "`match`"] + 3 -> 0 [ ] + 2 -> 0 [ ] + 1 -> 0 [ ] + 11 -> 7 [ ] + 5 -> 4 [ ] + 11 -> 1 [ ] + 0 -> 6 [ ] + 7 -> 8 [ label = "&"] + 9 -> 8 [ ] + 8 -> 10 [ ] + 4 -> 11 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_f10df8fa::HttpClient) -> crate::ApplicationState"] + 1 [ label = "app_f10df8fa::http_client(app_f10df8fa::Config) -> app_f10df8fa::HttpClient"] + 2 [ label = "app_f10df8fa::Config"] + 1 -> 0 [ ] + 2 -> 1 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/app_builder/expectations/app.rs b/libs/ui_tests/app_builder/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/app_builder/expectations/app.rs rename to libs/ui_tests/app_builder/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/app_builder/expectations/diagnostics.dot b/libs/ui_tests/app_builder/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/app_builder/expectations/diagnostics.dot rename to libs/ui_tests/app_builder/expectations/diagnostics.dot diff --git a/libs/ui_tests/app_builder/generated_app/Cargo.toml b/libs/ui_tests/app_builder/generated_app/Cargo.toml new file mode 100644 index 000000000..ef040f13e --- /dev/null +++ b/libs/ui_tests/app_builder/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_f10df8fa" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_f10df8fa = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/app_builder/generated_app/blueprint.ron b/libs/ui_tests/app_builder/generated_app/blueprint.ron new file mode 100644 index 000000000..704aba976 --- /dev/null +++ b/libs/ui_tests/app_builder/generated_app/blueprint.ron @@ -0,0 +1,120 @@ +( + creation_location: ( + line: 44, + column: 18, + file: "app_builder/src/lib.rs", + ), + components: [ + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_f10df8fa", + module_path: "app_f10df8fa", + ), + import_path: "crate::Config", + ), + location: ( + line: 45, + column: 8, + file: "app_builder/src/lib.rs", + ), + ), + cloning_strategy: Some(CloneIfNecessary), + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_f10df8fa", + module_path: "app_f10df8fa", + ), + import_path: "crate::http_client", + ), + location: ( + line: 46, + column: 8, + file: "app_builder/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_f10df8fa", + module_path: "app_f10df8fa", + ), + import_path: "crate::extract_path", + ), + location: ( + line: 47, + column: 8, + file: "app_builder/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_f10df8fa", + module_path: "app_f10df8fa", + ), + import_path: "crate::handle_extract_path_error", + ), + location: ( + line: 48, + column: 10, + file: "app_builder/src/lib.rs", + ), + )), + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_f10df8fa", + module_path: "app_f10df8fa", + ), + import_path: "crate::logger", + ), + location: ( + line: 49, + column: 8, + file: "app_builder/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_f10df8fa", + module_path: "app_f10df8fa", + ), + import_path: "crate::stream_file", + ), + location: ( + line: 50, + column: 8, + file: "app_builder/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/app_builder/generated_app/src/lib.rs b/libs/ui_tests/app_builder/generated_app/src/lib.rs new file mode 100644 index 000000000..4fb7a2e92 --- /dev/null +++ b/libs/ui_tests/app_builder/generated_app/src/lib.rs @@ -0,0 +1,196 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_f10df8fa::HttpClient, +} +pub async fn build_application_state( + v0: app_f10df8fa::Config, +) -> crate::ApplicationState { + let v1 = app_f10df8fa::http_client(v0); + crate::ApplicationState { s0: v1 } +} +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("/home", 0u32).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_1::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::GET => { + route_0::entrypoint( + server_state.application_state.s0.clone(), + request_head, + ) + .await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint( + s_0: app_f10df8fa::HttpClient, + s_1: pavex::request::RequestHead, + ) -> pavex::response::Response { + let response = wrapping_0(s_0, s_1).await; + response + } + async fn stage_1( + s_0: app_f10df8fa::HttpClient, + s_1: pavex::request::RequestHead, + ) -> pavex::response::Response { + let response = handler(s_0, s_1).await; + response + } + async fn wrapping_0( + v0: app_f10df8fa::HttpClient, + v1: pavex::request::RequestHead, + ) -> pavex::response::Response { + let v2 = crate::route_0::Next0 { + s_0: v0, + s_1: v1, + next: stage_1, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = pavex::middleware::wrap_noop(v3).await; + ::into_response(v4) + } + async fn handler( + v0: app_f10df8fa::HttpClient, + v1: pavex::request::RequestHead, + ) -> pavex::response::Response { + let v2 = app_f10df8fa::extract_path(v1).await; + let v3 = match v2 { + Ok(ok) => ok, + Err(v3) => { + return { + let v5 = { + let v4 = app_f10df8fa::logger(); + app_f10df8fa::handle_extract_path_error(&v3, v4) + }; + ::into_response( + v5, + ) + }; + } + }; + let v5 = { + let v4 = app_f10df8fa::logger(); + app_f10df8fa::stream_file(v3, v4, v0) + }; + ::into_response(v5) + } + struct Next0 + where + T: std::future::Future, + { + s_0: app_f10df8fa::HttpClient, + s_1: pavex::request::RequestHead, + next: fn(app_f10df8fa::HttpClient, pavex::request::RequestHead) -> 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)(self.s_0, self.s_1) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/app_builder/lib.rs b/libs/ui_tests/app_builder/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/app_builder/lib.rs rename to libs/ui_tests/app_builder/src/lib.rs diff --git a/libs/ui_tests/app_builder/src/main.rs b/libs/ui_tests/app_builder/src/main.rs new file mode 100644 index 000000000..bb8c49b1d --- /dev/null +++ b/libs/ui_tests/app_builder/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_f10df8fa::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/app_builder/test_config.toml b/libs/ui_tests/app_builder/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/app_builder/test_config.toml rename to libs/ui_tests/app_builder/test_config.toml diff --git a/libs/ui_tests/blueprint/common/async_callable_are_supported/Cargo.toml b/libs/ui_tests/blueprint/common/async_callable_are_supported/Cargo.toml new file mode 100644 index 000000000..ca3628cc0 --- /dev/null +++ b/libs/ui_tests/blueprint/common/async_callable_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_c62eca9e" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/common/async_callable_are_supported/diagnostics.dot b/libs/ui_tests/blueprint/common/async_callable_are_supported/diagnostics.dot new file mode 100644 index 000000000..de85b9c20 --- /dev/null +++ b/libs/ui_tests/blueprint/common/async_callable_are_supported/diagnostics.dot @@ -0,0 +1,55 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(pavex::request::RequestHead, &'a app_c62eca9e::HttpClient) -> crate::route_0::Next0<'a>"] + 3 [ label = "pavex::request::RequestHead"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&app_c62eca9e::HttpClient"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 5 [ ] + 6 -> 2 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_c62eca9e::stream_file(std::path::PathBuf, app_c62eca9e::Logger, &app_c62eca9e::HttpClient) -> pavex::response::Response"] + 1 [ label = "app_c62eca9e::extract_path(pavex::request::RequestHead) -> std::path::PathBuf"] + 2 [ label = "app_c62eca9e::logger() -> app_c62eca9e::Logger"] + 4 [ label = "pavex::request::RequestHead"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&app_c62eca9e::HttpClient"] + 2 -> 0 [ ] + 1 -> 0 [ ] + 4 -> 1 [ ] + 0 -> 5 [ ] + 6 -> 0 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_c62eca9e::HttpClient) -> crate::ApplicationState"] + 1 [ label = "app_c62eca9e::http_client(app_c62eca9e::Config) -> app_c62eca9e::HttpClient"] + 2 [ label = "app_c62eca9e::Config"] + 1 -> 0 [ ] + 2 -> 1 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/expectations/app.rs b/libs/ui_tests/blueprint/common/async_callable_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/expectations/app.rs rename to libs/ui_tests/blueprint/common/async_callable_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/expectations/diagnostics.dot b/libs/ui_tests/blueprint/common/async_callable_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/common/async_callable_are_supported/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..5fb589fcf --- /dev/null +++ b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_c62eca9e" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_c62eca9e = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..9a4c90465 --- /dev/null +++ b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/blueprint.ron @@ -0,0 +1,107 @@ +( + creation_location: ( + line: 35, + column: 18, + file: "blueprint/common/async_callable_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c62eca9e", + module_path: "app_c62eca9e", + ), + import_path: "crate::http_client", + ), + location: ( + line: 36, + column: 8, + file: "blueprint/common/async_callable_are_supported/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c62eca9e", + module_path: "app_c62eca9e", + ), + import_path: "crate::extract_path", + ), + location: ( + line: 37, + column: 8, + file: "blueprint/common/async_callable_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c62eca9e", + module_path: "app_c62eca9e", + ), + import_path: "crate::logger", + ), + location: ( + line: 38, + column: 8, + file: "blueprint/common/async_callable_are_supported/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_c62eca9e", + module_path: "app_c62eca9e", + ), + import_path: "crate::Config", + ), + location: ( + line: 39, + column: 8, + file: "blueprint/common/async_callable_are_supported/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c62eca9e", + module_path: "app_c62eca9e", + ), + import_path: "crate::stream_file", + ), + location: ( + line: 40, + column: 8, + file: "blueprint/common/async_callable_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..003c97e75 --- /dev/null +++ b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/src/lib.rs @@ -0,0 +1,179 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_c62eca9e::HttpClient, +} +pub async fn build_application_state( + v0: app_c62eca9e::Config, +) -> crate::ApplicationState { + let v1 = app_c62eca9e::http_client(v0).await; + crate::ApplicationState { s0: v1 } +} +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("/home", 0u32).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_1::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::GET => { + route_0::entrypoint(request_head, &server_state.application_state.s0) + .await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>( + s_0: pavex::request::RequestHead, + s_1: &'a app_c62eca9e::HttpClient, + ) -> pavex::response::Response { + let response = wrapping_0(s_0, s_1).await; + response + } + async fn stage_1<'a>( + s_0: pavex::request::RequestHead, + s_1: &'a app_c62eca9e::HttpClient, + ) -> pavex::response::Response { + let response = handler(s_0, s_1).await; + response + } + async fn wrapping_0( + v0: pavex::request::RequestHead, + v1: &app_c62eca9e::HttpClient, + ) -> pavex::response::Response { + let v2 = crate::route_0::Next0 { + s_0: v0, + s_1: v1, + next: stage_1, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = pavex::middleware::wrap_noop(v3).await; + ::into_response(v4) + } + async fn handler( + v0: pavex::request::RequestHead, + v1: &app_c62eca9e::HttpClient, + ) -> pavex::response::Response { + let v2 = app_c62eca9e::extract_path(v0).await; + let v4 = { + let v3 = app_c62eca9e::logger().await; + app_c62eca9e::stream_file(v2, v3, v1).await + }; + ::into_response(v4) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: pavex::request::RequestHead, + s_1: &'a app_c62eca9e::HttpClient, + next: fn(pavex::request::RequestHead, &'a app_c62eca9e::HttpClient) -> 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, self.s_1) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/lib.rs b/libs/ui_tests/blueprint/common/async_callable_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/lib.rs rename to libs/ui_tests/blueprint/common/async_callable_are_supported/src/lib.rs diff --git a/libs/ui_tests/blueprint/common/async_callable_are_supported/src/main.rs b/libs/ui_tests/blueprint/common/async_callable_are_supported/src/main.rs new file mode 100644 index 000000000..a67d8f2d4 --- /dev/null +++ b/libs/ui_tests/blueprint/common/async_callable_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_c62eca9e::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/test_config.toml b/libs/ui_tests/blueprint/common/async_callable_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/async_callable_are_supported/test_config.toml rename to libs/ui_tests/blueprint/common/async_callable_are_supported/test_config.toml diff --git a/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/Cargo.toml b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/Cargo.toml new file mode 100644 index 000000000..a71381714 --- /dev/null +++ b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_56692d2c" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_return_the_unit_type/expectations/stderr.txt b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_return_the_unit_type/expectations/stderr.txt rename to libs/ui_tests/blueprint/common/cannot_return_the_unit_type/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/Cargo.toml new file mode 100644 index 000000000..459ba445a --- /dev/null +++ b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_56692d2c" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/blueprint.ron new file mode 100644 index 000000000..9a1d75aa4 --- /dev/null +++ b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/blueprint.ron @@ -0,0 +1,299 @@ +( + creation_location: ( + line: 61, + column: 18, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::constructor", + ), + location: ( + line: 62, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::fallible_unit_constructor", + ), + location: ( + line: 63, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::fallible_constructor", + ), + location: ( + line: 64, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 65, + column: 10, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + )), + lints: {}, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::unit_pre", + ), + location: ( + line: 67, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::fallible_unit_pre", + ), + location: ( + line: 68, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 69, + column: 10, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + )), + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::unit_wrapping", + ), + location: ( + line: 71, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + error_handler: None, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::fallible_unit_wrapping", + ), + location: ( + line: 72, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 73, + column: 10, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + )), + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::unit_post", + ), + location: ( + line: 75, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::fallible_unit_post", + ), + location: ( + line: 76, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 77, + column: 10, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + )), + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::handler", + ), + location: ( + line: 79, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/unit", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::unit_handler", + ), + location: ( + line: 80, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/fallible_unit", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::fallible_unit_handler", + ), + location: ( + line: 81, + column: 8, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_56692d2c", + module_path: "app_56692d2c", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 82, + column: 10, + file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", + ), + )), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_return_the_unit_type/lib.rs b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_return_the_unit_type/lib.rs rename to libs/ui_tests/blueprint/common/cannot_return_the_unit_type/src/lib.rs diff --git a/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/src/main.rs b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/src/main.rs new file mode 100644 index 000000000..9a1ab17cf --- /dev/null +++ b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_56692d2c::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_return_the_unit_type/test_config.toml b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_return_the_unit_type/test_config.toml rename to libs/ui_tests/blueprint/common/cannot_return_the_unit_type/test_config.toml diff --git a/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/Cargo.toml b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/Cargo.toml new file mode 100644 index 000000000..b837061d0 --- /dev/null +++ b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_d24e80c4" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/expectations/stderr.txt b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/expectations/stderr.txt rename to libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/Cargo.toml new file mode 100644 index 000000000..ce9434d86 --- /dev/null +++ b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_d24e80c4" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/blueprint.ron new file mode 100644 index 000000000..837fc92ac --- /dev/null +++ b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/blueprint.ron @@ -0,0 +1,96 @@ +( + creation_location: ( + line: 31, + column: 18, + file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d24e80c4", + module_path: "app_d24e80c4", + ), + import_path: "crate::constructor", + ), + location: ( + line: 32, + column: 8, + file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_d24e80c4", + module_path: "app_d24e80c4", + ), + import_path: "crate::wrapping", + ), + location: ( + line: 33, + column: 8, + file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", + ), + ), + error_handler: None, + )), + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_d24e80c4", + module_path: "app_d24e80c4", + ), + import_path: "crate::observer", + ), + location: ( + line: 34, + column: 8, + file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", + ), + ), + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_d24e80c4", + module_path: "app_d24e80c4", + ), + import_path: "crate::handler", + ), + location: ( + line: 35, + column: 8, + file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_d24e80c4", + module_path: "app_d24e80c4", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 36, + column: 10, + file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", + ), + )), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/lib.rs b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/lib.rs rename to libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs diff --git a/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/src/main.rs b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/src/main.rs new file mode 100644 index 000000000..c194fc1d2 --- /dev/null +++ b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_d24e80c4::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/test_config.toml b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/test_config.toml rename to libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/test_config.toml diff --git a/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/Cargo.toml b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/Cargo.toml new file mode 100644 index 000000000..551062950 --- /dev/null +++ b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_46ab7f5d" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/expectations/stderr.txt b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/expectations/stderr.txt rename to libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/Cargo.toml new file mode 100644 index 000000000..574e58bd5 --- /dev/null +++ b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_46ab7f5d" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/blueprint.ron new file mode 100644 index 000000000..663b7326f --- /dev/null +++ b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/blueprint.ron @@ -0,0 +1,87 @@ +( + creation_location: ( + line: 22, + column: 18, + file: "blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs", + ), + components: [ + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_46ab7f5d", + module_path: "app_46ab7f5d", + ), + import_path: "crate::C", + ), + location: ( + line: 23, + column: 8, + file: "blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs", + ), + ), + cloning_strategy: Some(CloneIfNecessary), + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_46ab7f5d", + module_path: "app_46ab7f5d", + ), + import_path: "crate::singleton", + ), + location: ( + line: 24, + column: 8, + file: "blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_46ab7f5d", + module_path: "app_46ab7f5d", + ), + import_path: "crate::request_scoped", + ), + location: ( + line: 25, + column: 8, + file: "blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_46ab7f5d", + module_path: "app_46ab7f5d", + ), + import_path: "crate::handler", + ), + location: ( + line: 27, + column: 8, + file: "blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/lib.rs b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/lib.rs rename to libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs diff --git a/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/src/main.rs b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/src/main.rs new file mode 100644 index 000000000..9f8315f05 --- /dev/null +++ b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_46ab7f5d::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/test_config.toml b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/test_config.toml rename to libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/test_config.toml diff --git a/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/Cargo.toml b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/Cargo.toml new file mode 100644 index 000000000..500d53a06 --- /dev/null +++ b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_b02b0728" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/expectations/stderr.txt b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/expectations/stderr.txt rename to libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/Cargo.toml new file mode 100644 index 000000000..ad043daf2 --- /dev/null +++ b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_b02b0728" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/blueprint.ron new file mode 100644 index 000000000..56791b28a --- /dev/null +++ b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/blueprint.ron @@ -0,0 +1,87 @@ +( + creation_location: ( + line: 27, + column: 18, + file: "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs", + ), + components: [ + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_b02b0728", + module_path: "app_b02b0728", + ), + import_path: "crate::B", + ), + location: ( + line: 28, + column: 8, + file: "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_b02b0728", + module_path: "app_b02b0728", + ), + import_path: "crate::singleton", + ), + location: ( + line: 29, + column: 8, + file: "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_b02b0728", + module_path: "app_b02b0728", + ), + import_path: "crate::singleton2", + ), + location: ( + line: 30, + column: 8, + file: "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_b02b0728", + module_path: "app_b02b0728", + ), + import_path: "crate::handler", + ), + location: ( + line: 31, + column: 8, + file: "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/lib.rs b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/lib.rs rename to libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs diff --git a/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/main.rs b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/main.rs new file mode 100644 index 000000000..efa01077d --- /dev/null +++ b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_b02b0728::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/test_config.toml b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/test_config.toml rename to libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/test_config.toml diff --git a/libs/ui_tests/blueprint/common/components_can_fail/Cargo.toml b/libs/ui_tests/blueprint/common/components_can_fail/Cargo.toml new file mode 100644 index 000000000..8ad49296c --- /dev/null +++ b/libs/ui_tests/blueprint/common/components_can_fail/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "app_e501823b" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies] +thiserror = "1" + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/common/components_can_fail/diagnostics.dot b/libs/ui_tests/blueprint/common/components_can_fail/diagnostics.dot new file mode 100644 index 000000000..3afb63b22 --- /dev/null +++ b/libs/ui_tests/blueprint/common/components_can_fail/diagnostics.dot @@ -0,0 +1,223 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(pavex::request::RequestHead, &'a app_e501823b::HttpClient) -> crate::route_0::Next0<'a>"] + 3 [ label = "pavex::request::RequestHead"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&app_e501823b::HttpClient"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 5 [ ] + 6 -> 2 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_e501823b::fallible_wrapping_middleware(pavex::middleware::Next>) -> core::prelude::rust_2015::Result"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next1<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next1(pavex::request::RequestHead, &'a app_e501823b::HttpClient) -> crate::route_0::Next1<'a>"] + 3 [ label = "pavex::request::RequestHead"] + 5 [ label = "core::prelude::rust_2015::Result -> pavex::response::Response"] + 6 [ label = "core::prelude::rust_2015::Result -> app_e501823b::MiddlewareError"] + 7 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 8 [ label = "app_e501823b::handle_middleware_error(&app_e501823b::MiddlewareError) -> pavex::response::Response"] + 9 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 10 [ label = "`match`"] + 11 [ label = "&app_e501823b::HttpClient"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 10 -> 5 [ ] + 10 -> 6 [ ] + 6 -> 8 [ label = "&"] + 5 -> 7 [ ] + 8 -> 9 [ ] + 0 -> 10 [ ] + 11 -> 2 [ ] +} + +digraph "GET /home - 2" { + 0 [ label = "app_e501823b::fallible_pre() -> core::prelude::rust_2015::Result, app_e501823b::PreError>"] + 1 [ label = "core::prelude::rust_2015::Result, app_e501823b::PreError> -> pavex::middleware::Processing"] + 2 [ label = "core::prelude::rust_2015::Result, app_e501823b::PreError> -> app_e501823b::PreError"] + 3 [ label = "app_e501823b::pre_error(&app_e501823b::PreError) -> pavex::response::Response"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "pavex::middleware::Processing::EarlyReturn(pavex::response::Response) -> pavex::middleware::Processing"] + 6 [ label = "`match`"] + 6 -> 1 [ ] + 6 -> 2 [ ] + 2 -> 3 [ label = "&"] + 3 -> 4 [ ] + 4 -> 5 [ ] + 0 -> 6 [ ] +} + +digraph "GET /home - 3" { + 0 [ label = "app_e501823b::request_handler(std::path::PathBuf, app_e501823b::Logger, &app_e501823b::HttpClient) -> core::prelude::rust_2015::Result"] + 1 [ label = "core::prelude::rust_2015::Result> -> std::path::PathBuf"] + 2 [ label = "core::prelude::rust_2015::Result -> app_e501823b::Logger"] + 4 [ label = "app_e501823b::logger() -> core::prelude::rust_2015::Result"] + 5 [ label = "app_e501823b::extract_path(pavex::request::RequestHead) -> core::prelude::rust_2015::Result>"] + 6 [ label = "pavex::request::RequestHead"] + 7 [ label = "core::prelude::rust_2015::Result -> pavex::response::Response"] + 8 [ label = "core::prelude::rust_2015::Result -> app_e501823b::HandlerError"] + 9 [ label = "core::prelude::rust_2015::Result -> app_e501823b::LoggerError"] + 10 [ label = "core::prelude::rust_2015::Result> -> app_e501823b::ExtractPathError"] + 11 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 12 [ label = "app_e501823b::handle_handler_error(&app_e501823b::HandlerError) -> pavex::response::Response"] + 13 [ label = "app_e501823b::handle_logger_error(&app_e501823b::LoggerError) -> pavex::response::Response"] + 14 [ label = "app_e501823b::handle_extract_path_error(&app_e501823b::ExtractPathError, app_e501823b::Logger) -> pavex::response::Response"] + 15 [ label = "core::prelude::rust_2015::Result -> app_e501823b::Logger"] + 16 [ label = "app_e501823b::logger() -> core::prelude::rust_2015::Result"] + 17 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 18 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 19 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 20 [ label = "core::prelude::rust_2015::Result -> app_e501823b::LoggerError"] + 21 [ label = "app_e501823b::handle_logger_error(&app_e501823b::LoggerError) -> pavex::response::Response"] + 22 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 23 [ label = "`match`"] + 24 [ label = "`match`"] + 25 [ label = "`match`"] + 26 [ label = "`match`"] + 27 [ label = "&app_e501823b::HttpClient"] + 2 -> 0 [ ] + 24 -> 9 [ ] + 1 -> 0 [ ] + 25 -> 10 [ ] + 6 -> 5 [ ] + 25 -> 1 [ ] + 24 -> 2 [ ] + 23 -> 7 [ ] + 23 -> 8 [ ] + 10 -> 14 [ label = "&"] + 15 -> 14 [ ] + 26 -> 20 [ ] + 9 -> 13 [ label = "&"] + 8 -> 12 [ label = "&"] + 7 -> 11 [ ] + 26 -> 15 [ ] + 14 -> 19 [ ] + 13 -> 18 [ ] + 12 -> 17 [ ] + 20 -> 21 [ label = "&"] + 21 -> 22 [ ] + 0 -> 23 [ ] + 4 -> 24 [ ] + 5 -> 25 [ ] + 16 -> 26 [ ] + 27 -> 0 [ ] +} + +digraph "GET /home - 4" { + 0 [ label = "app_e501823b::fallible_post(pavex::response::Response) -> core::prelude::rust_2015::Result"] + 1 [ label = "pavex::response::Response"] + 2 [ label = "core::prelude::rust_2015::Result -> pavex::response::Response"] + 3 [ label = "core::prelude::rust_2015::Result -> app_e501823b::PostError"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "app_e501823b::post_error(&app_e501823b::PostError) -> pavex::response::Response"] + 6 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 7 [ label = "`match`"] + 1 -> 0 [ ] + 7 -> 2 [ ] + 7 -> 3 [ ] + 3 -> 5 [ label = "&"] + 2 -> 4 [ ] + 5 -> 6 [ ] + 0 -> 7 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "app_e501823b::fallible_wrapping_middleware(pavex::middleware::Next>) -> core::prelude::rust_2015::Result"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next1<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next1(&'a pavex::router::AllowedMethods) -> crate::route_1::Next1<'a>"] + 4 [ label = "core::prelude::rust_2015::Result -> pavex::response::Response"] + 5 [ label = "core::prelude::rust_2015::Result -> app_e501823b::MiddlewareError"] + 6 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 7 [ label = "app_e501823b::handle_middleware_error(&app_e501823b::MiddlewareError) -> pavex::response::Response"] + 8 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 9 [ label = "`match`"] + 10 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 9 -> 4 [ ] + 9 -> 5 [ ] + 5 -> 7 [ label = "&"] + 4 -> 6 [ ] + 7 -> 8 [ ] + 0 -> 9 [ ] + 10 -> 2 [ ] +} + +digraph "* /home - 2" { + 0 [ label = "app_e501823b::fallible_pre() -> core::prelude::rust_2015::Result, app_e501823b::PreError>"] + 1 [ label = "core::prelude::rust_2015::Result, app_e501823b::PreError> -> pavex::middleware::Processing"] + 2 [ label = "core::prelude::rust_2015::Result, app_e501823b::PreError> -> app_e501823b::PreError"] + 3 [ label = "app_e501823b::pre_error(&app_e501823b::PreError) -> pavex::response::Response"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "pavex::middleware::Processing::EarlyReturn(pavex::response::Response) -> pavex::middleware::Processing"] + 6 [ label = "`match`"] + 6 -> 1 [ ] + 6 -> 2 [ ] + 2 -> 3 [ label = "&"] + 3 -> 4 [ ] + 4 -> 5 [ ] + 0 -> 6 [ ] +} + +digraph "* /home - 3" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* /home - 4" { + 0 [ label = "app_e501823b::fallible_post(pavex::response::Response) -> core::prelude::rust_2015::Result"] + 1 [ label = "pavex::response::Response"] + 2 [ label = "core::prelude::rust_2015::Result -> pavex::response::Response"] + 3 [ label = "core::prelude::rust_2015::Result -> app_e501823b::PostError"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "app_e501823b::post_error(&app_e501823b::PostError) -> pavex::response::Response"] + 6 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 7 [ label = "`match`"] + 1 -> 0 [ ] + 7 -> 2 [ ] + 7 -> 3 [ ] + 3 -> 5 [ label = "&"] + 2 -> 4 [ ] + 5 -> 6 [ ] + 0 -> 7 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_e501823b::HttpClient) -> crate::ApplicationState"] + 1 [ label = "core::prelude::rust_2015::Result -> app_e501823b::HttpClient"] + 2 [ label = "app_e501823b::http_client(app_e501823b::Config) -> core::prelude::rust_2015::Result"] + 3 [ label = "app_e501823b::Config"] + 4 [ label = "core::result::Result::Ok(crate::ApplicationState) -> core::result::Result"] + 5 [ label = "core::prelude::rust_2015::Result -> app_e501823b::HttpClientError"] + 6 [ label = "crate::ApplicationStateError::HttpClient(app_e501823b::HttpClientError) -> crate::ApplicationStateError"] + 7 [ label = "core::result::Result::Err(crate::ApplicationStateError) -> core::result::Result"] + 8 [ label = "`match`"] + 1 -> 0 [ ] + 8 -> 5 [ ] + 3 -> 2 [ ] + 8 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 6 [ ] + 6 -> 7 [ ] + 2 -> 8 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/components_can_fail/expectations/app.rs b/libs/ui_tests/blueprint/common/components_can_fail/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/components_can_fail/expectations/app.rs rename to libs/ui_tests/blueprint/common/components_can_fail/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/components_can_fail/expectations/diagnostics.dot b/libs/ui_tests/blueprint/common/components_can_fail/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/components_can_fail/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/common/components_can_fail/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml new file mode 100644 index 000000000..1ae7cc525 --- /dev/null +++ b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_e501823b" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_e501823b = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/blueprint.ron new file mode 100644 index 000000000..4af433354 --- /dev/null +++ b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/blueprint.ron @@ -0,0 +1,236 @@ +( + creation_location: ( + line: 102, + column: 18, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + components: [ + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::Config", + ), + location: ( + line: 103, + column: 8, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::http_client", + ), + location: ( + line: 104, + column: 8, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::extract_path", + ), + location: ( + line: 105, + column: 8, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::handle_extract_path_error", + ), + location: ( + line: 106, + column: 10, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + )), + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::logger", + ), + location: ( + line: 107, + column: 8, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::handle_logger_error", + ), + location: ( + line: 108, + column: 10, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + )), + lints: {}, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::fallible_wrapping_middleware", + ), + location: ( + line: 109, + column: 8, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::handle_middleware_error", + ), + location: ( + line: 110, + column: 10, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + )), + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::fallible_pre", + ), + location: ( + line: 111, + column: 8, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::pre_error", + ), + location: ( + line: 112, + column: 10, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + )), + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::fallible_post", + ), + location: ( + line: 113, + column: 8, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::post_error", + ), + location: ( + line: 114, + column: 10, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + )), + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::request_handler", + ), + location: ( + line: 115, + column: 8, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_e501823b", + module_path: "app_e501823b", + ), + import_path: "crate::handle_handler_error", + ), + location: ( + line: 116, + column: 10, + file: "blueprint/common/components_can_fail/src/lib.rs", + ), + )), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/src/lib.rs new file mode 100644 index 000000000..522f6a873 --- /dev/null +++ b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/src/lib.rs @@ -0,0 +1,407 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_e501823b::HttpClient, +} +#[derive(Debug, thiserror::Error)] +pub enum ApplicationStateError { + #[error(transparent)] + HttpClient(app_e501823b::HttpClientError), +} +pub async fn build_application_state( + v0: app_e501823b::Config, +) -> Result { + let v1 = app_e501823b::http_client(v0); + let v2 = match v1 { + Ok(ok) => ok, + Err(v2) => { + return { + let v3 = crate::ApplicationStateError::HttpClient(v2); + core::result::Result::Err(v3) + }; + } + }; + let v3 = crate::ApplicationState { s0: v2 }; + core::result::Result::Ok(v3) +} +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("/home", 0u32).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_1::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::GET => { + route_0::entrypoint(request_head, &server_state.application_state.s0) + .await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>( + s_0: pavex::request::RequestHead, + s_1: &'a app_e501823b::HttpClient, + ) -> pavex::response::Response { + let response = wrapping_0(s_0, s_1).await; + response + } + async fn stage_1<'a>( + s_0: pavex::request::RequestHead, + s_1: &'a app_e501823b::HttpClient, + ) -> pavex::response::Response { + let response = wrapping_1(s_0, s_1).await; + response + } + async fn stage_2<'a>( + s_0: pavex::request::RequestHead, + s_1: &'a app_e501823b::HttpClient, + ) -> pavex::response::Response { + if let Some(response) = pre_processing_0().await.into_response() { + return response; + } + let response = handler(s_0, s_1).await; + let response = post_processing_0(response).await; + response + } + async fn wrapping_0( + v0: pavex::request::RequestHead, + v1: &app_e501823b::HttpClient, + ) -> pavex::response::Response { + let v2 = crate::route_0::Next0 { + s_0: v0, + s_1: v1, + next: stage_1, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = pavex::middleware::wrap_noop(v3).await; + ::into_response(v4) + } + async fn wrapping_1( + v0: pavex::request::RequestHead, + v1: &app_e501823b::HttpClient, + ) -> pavex::response::Response { + let v2 = crate::route_0::Next1 { + s_0: v0, + s_1: v1, + next: stage_2, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = app_e501823b::fallible_wrapping_middleware(v3); + let v5 = match v4 { + Ok(ok) => ok, + Err(v5) => { + return { + let v6 = app_e501823b::handle_middleware_error(&v5); + ::into_response( + v6, + ) + }; + } + }; + ::into_response(v5) + } + async fn pre_processing_0() -> pavex::middleware::Processing< + pavex::response::Response, + > { + let v0 = app_e501823b::fallible_pre(); + let v1 = match v0 { + Ok(ok) => ok, + Err(v1) => { + return { + let v2 = app_e501823b::pre_error(&v1); + let v3 = ::into_response( + v2, + ); + pavex::middleware::Processing::EarlyReturn(v3) + }; + } + }; + v1 + } + async fn handler( + v0: pavex::request::RequestHead, + v1: &app_e501823b::HttpClient, + ) -> pavex::response::Response { + let v2 = match app_e501823b::logger() { + Ok(ok) => ok, + Err(v2) => { + return { + let v3 = app_e501823b::handle_logger_error(&v2); + ::into_response( + v3, + ) + }; + } + }; + let v3 = app_e501823b::extract_path(v0); + let v4 = match v3 { + Ok(ok) => ok, + Err(v4) => { + return { + let v5 = match app_e501823b::logger() { + Ok(ok) => ok, + Err(v5) => { + return { + let v6 = app_e501823b::handle_logger_error(&v5); + ::into_response( + v6, + ) + }; + } + }; + let v6 = app_e501823b::handle_extract_path_error(&v4, v5); + ::into_response( + v6, + ) + }; + } + }; + let v5 = app_e501823b::request_handler(v4, v2, v1); + let v6 = match v5 { + Ok(ok) => ok, + Err(v6) => { + return { + let v7 = app_e501823b::handle_handler_error(&v6); + ::into_response( + v7, + ) + }; + } + }; + ::into_response(v6) + } + async fn post_processing_0( + v0: pavex::response::Response, + ) -> pavex::response::Response { + let v1 = app_e501823b::fallible_post(v0); + let v2 = match v1 { + Ok(ok) => ok, + Err(v2) => { + return { + let v3 = app_e501823b::post_error(&v2); + ::into_response( + v3, + ) + }; + } + }; + ::into_response(v2) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: pavex::request::RequestHead, + s_1: &'a app_e501823b::HttpClient, + next: fn(pavex::request::RequestHead, &'a app_e501823b::HttpClient) -> 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, self.s_1) + } + } + struct Next1<'a, T> + where + T: std::future::Future, + { + s_0: pavex::request::RequestHead, + s_1: &'a app_e501823b::HttpClient, + next: fn(pavex::request::RequestHead, &'a app_e501823b::HttpClient) -> T, + } + impl<'a, T> std::future::IntoFuture for Next1<'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, self.s_1) + } + } +} +pub mod route_1 { + 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 = wrapping_1(s_0).await; + response + } + async fn stage_2<'a>( + s_0: &'a pavex::router::AllowedMethods, + ) -> pavex::response::Response { + if let Some(response) = pre_processing_0().await.into_response() { + return response; + } + let response = handler(s_0).await; + let response = post_processing_0(response).await; + response + } + async fn wrapping_0( + v0: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v1 = crate::route_1::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 wrapping_1( + v0: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v1 = crate::route_1::Next1 { + s_0: v0, + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_e501823b::fallible_wrapping_middleware(v2); + let v4 = match v3 { + Ok(ok) => ok, + Err(v4) => { + return { + let v5 = app_e501823b::handle_middleware_error(&v4); + ::into_response( + v5, + ) + }; + } + }; + ::into_response(v4) + } + async fn pre_processing_0() -> pavex::middleware::Processing< + pavex::response::Response, + > { + let v0 = app_e501823b::fallible_pre(); + let v1 = match v0 { + Ok(ok) => ok, + Err(v1) => { + return { + let v2 = app_e501823b::pre_error(&v1); + let v3 = ::into_response( + v2, + ); + pavex::middleware::Processing::EarlyReturn(v3) + }; + } + }; + v1 + } + async fn handler(v0: &pavex::router::AllowedMethods) -> pavex::response::Response { + let v1 = pavex::router::default_fallback(v0).await; + ::into_response(v1) + } + async fn post_processing_0( + v0: pavex::response::Response, + ) -> pavex::response::Response { + let v1 = app_e501823b::fallible_post(v0); + let v2 = match v1 { + Ok(ok) => ok, + Err(v2) => { + return { + let v3 = app_e501823b::post_error(&v2); + ::into_response( + v3, + ) + }; + } + }; + ::into_response(v2) + } + 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) + } + } + struct Next1<'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 Next1<'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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/components_can_fail/lib.rs b/libs/ui_tests/blueprint/common/components_can_fail/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/components_can_fail/lib.rs rename to libs/ui_tests/blueprint/common/components_can_fail/src/lib.rs diff --git a/libs/ui_tests/blueprint/common/components_can_fail/src/main.rs b/libs/ui_tests/blueprint/common/components_can_fail/src/main.rs new file mode 100644 index 000000000..e868ebb7a --- /dev/null +++ b/libs/ui_tests/blueprint/common/components_can_fail/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_e501823b::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/components_can_fail/test_config.toml b/libs/ui_tests/blueprint/common/components_can_fail/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/components_can_fail/test_config.toml rename to libs/ui_tests/blueprint/common/components_can_fail/test_config.toml diff --git a/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/Cargo.toml b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/Cargo.toml new file mode 100644 index 000000000..cf63e190e --- /dev/null +++ b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_11354b55" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/output_type_must_implement_into_response/expectations/stderr.txt b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/output_type_must_implement_into_response/expectations/stderr.txt rename to libs/ui_tests/blueprint/common/output_type_must_implement_into_response/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/Cargo.toml new file mode 100644 index 000000000..30646fe9e --- /dev/null +++ b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_11354b55" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/blueprint.ron new file mode 100644 index 000000000..977c04ccc --- /dev/null +++ b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/blueprint.ron @@ -0,0 +1,136 @@ +( + creation_location: ( + line: 37, + column: 18, + file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", + ), + components: [ + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_11354b55", + module_path: "app_11354b55", + ), + import_path: "crate::wrapping_middleware", + ), + location: ( + line: 38, + column: 8, + file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_11354b55", + module_path: "app_11354b55", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 39, + column: 10, + file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", + ), + )), + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_11354b55", + module_path: "app_11354b55", + ), + import_path: "crate::pp_middleware", + ), + location: ( + line: 40, + column: 8, + file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_11354b55", + module_path: "app_11354b55", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 41, + column: 10, + file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", + ), + )), + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_11354b55", + module_path: "app_11354b55", + ), + import_path: "crate::request_scoped", + ), + location: ( + line: 42, + column: 8, + file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_11354b55", + module_path: "app_11354b55", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 43, + column: 10, + file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_11354b55", + module_path: "app_11354b55", + ), + import_path: "crate::handler", + ), + location: ( + line: 44, + column: 8, + file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_11354b55", + module_path: "app_11354b55", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 45, + column: 10, + file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", + ), + )), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/output_type_must_implement_into_response/lib.rs b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/output_type_must_implement_into_response/lib.rs rename to libs/ui_tests/blueprint/common/output_type_must_implement_into_response/src/lib.rs diff --git a/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/src/main.rs b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/src/main.rs new file mode 100644 index 000000000..50b991d29 --- /dev/null +++ b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_11354b55::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/common/output_type_must_implement_into_response/test_config.toml b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/common/output_type_must_implement_into_response/test_config.toml rename to libs/ui_tests/blueprint/common/output_type_must_implement_into_response/test_config.toml diff --git a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/Cargo.toml b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/Cargo.toml new file mode 100644 index 000000000..f20b79613 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_30248169" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/diagnostics.dot b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/diagnostics.dot new file mode 100644 index 000000000..212afdb4c --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/diagnostics.dot @@ -0,0 +1,3 @@ +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/app.rs b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/app.rs rename to libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/diagnostics.dot b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/stderr.txt b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/stderr.txt rename to libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml new file mode 100644 index 000000000..2766fbe13 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "application_30248169" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/blueprint.ron new file mode 100644 index 000000000..1f36bc5b5 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/blueprint.ron @@ -0,0 +1,29 @@ +( + creation_location: ( + line: 13, + column: 18, + file: "blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_30248169", + module_path: "app_30248169", + ), + import_path: "crate::Unused::new", + ), + location: ( + line: 14, + column: 8, + file: "blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/src/lib.rs new file mode 100644 index 000000000..74f099cc2 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/src/lib.rs @@ -0,0 +1,101 @@ +//! 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 +} +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_0::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 { + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + 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_0::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/lib.rs b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/lib.rs rename to libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src/lib.rs diff --git a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src/main.rs b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src/main.rs new file mode 100644 index 000000000..1fc71c398 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_30248169::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/test_config.toml b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/test_config.toml rename to libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/test_config.toml diff --git a/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/Cargo.toml b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/Cargo.toml new file mode 100644 index 000000000..6a64f95b2 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_a442c90a" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/expectations/stderr.txt b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/expectations/stderr.txt rename to libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/Cargo.toml new file mode 100644 index 000000000..a08ad51e2 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_a442c90a" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/blueprint.ron new file mode 100644 index 000000000..ee9eb86c9 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 19, + column: 18, + file: "blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_a442c90a", + module_path: "app_a442c90a", + ), + import_path: "crate::generic_constructor", + ), + location: ( + line: 20, + column: 5, + file: "blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a442c90a", + module_path: "app_a442c90a", + ), + import_path: "crate::handler", + ), + location: ( + line: 21, + column: 8, + file: "blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/lib.rs b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/lib.rs rename to libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/lib.rs diff --git a/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/main.rs b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/main.rs new file mode 100644 index 000000000..fe19b4d43 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_a442c90a::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/test_config.toml b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/test_config.toml rename to libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/test_config.toml diff --git a/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/Cargo.toml b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/Cargo.toml new file mode 100644 index 000000000..4975fa2f2 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_ebc534c7" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/expectations/stderr.txt b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/expectations/stderr.txt rename to libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/Cargo.toml new file mode 100644 index 000000000..d17d3574c --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_ebc534c7" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/blueprint.ron new file mode 100644 index 000000000..d9f2f4fd3 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 27, + column: 18, + file: "blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ebc534c7", + module_path: "app_ebc534c7", + ), + import_path: "crate::generic_constructor", + ), + location: ( + line: 28, + column: 8, + file: "blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ebc534c7", + module_path: "app_ebc534c7", + ), + import_path: "crate::doubly_generic_constructor", + ), + location: ( + line: 29, + column: 8, + file: "blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ebc534c7", + module_path: "app_ebc534c7", + ), + import_path: "crate::triply_generic_constructor", + ), + location: ( + line: 30, + column: 8, + file: "blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ebc534c7", + module_path: "app_ebc534c7", + ), + import_path: "crate::handler", + ), + location: ( + line: 31, + column: 8, + file: "blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/lib.rs b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/lib.rs rename to libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs diff --git a/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/main.rs b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/main.rs new file mode 100644 index 000000000..0fc3c3bc5 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ebc534c7::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/test_config.toml b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/test_config.toml rename to libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/test_config.toml diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/Cargo.toml b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/Cargo.toml new file mode 100644 index 000000000..4465a83b2 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_ea979460" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/diagnostics.dot b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/diagnostics.dot new file mode 100644 index 000000000..e2fb04ece --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/diagnostics.dot @@ -0,0 +1,94 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_ea979460::handler(app_ea979460::Json, app_ea979460::Json>, &app_ea979460::Json, app_ea979460::Form, app_ea979460::FallibleForm, &app_ea979460::FallibleForm, &app_ea979460::FallibleForm2) -> pavex::response::Response"] + 1 [ label = "app_ea979460::json() -> app_ea979460::Json"] + 2 [ label = "app_ea979460::json() -> app_ea979460::Json>"] + 3 [ label = "app_ea979460::json() -> app_ea979460::Json"] + 4 [ label = "core::prelude::rust_2015::Result, app_ea979460::FallibleError> -> app_ea979460::Form"] + 5 [ label = "core::prelude::rust_2015::Result, app_ea979460::GenericError> -> app_ea979460::FallibleForm"] + 6 [ label = "core::prelude::rust_2015::Result, app_ea979460::GenericError> -> app_ea979460::FallibleForm"] + 7 [ label = "core::prelude::rust_2015::Result, app_ea979460::GenericError> -> app_ea979460::FallibleForm2"] + 8 [ label = "app_ea979460::fallible_with_generic_error2() -> core::prelude::rust_2015::Result, app_ea979460::GenericError>"] + 9 [ label = "app_ea979460::fallible_with_generic_error() -> core::prelude::rust_2015::Result, app_ea979460::GenericError>"] + 10 [ label = "app_ea979460::fallible_with_generic_error() -> core::prelude::rust_2015::Result, app_ea979460::GenericError>"] + 11 [ label = "app_ea979460::fallible() -> core::prelude::rust_2015::Result, app_ea979460::FallibleError>"] + 12 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 13 [ label = "core::prelude::rust_2015::Result, app_ea979460::GenericError> -> app_ea979460::GenericError"] + 14 [ label = "core::prelude::rust_2015::Result, app_ea979460::GenericError> -> app_ea979460::GenericError"] + 15 [ label = "core::prelude::rust_2015::Result, app_ea979460::GenericError> -> app_ea979460::GenericError"] + 16 [ label = "core::prelude::rust_2015::Result, app_ea979460::FallibleError> -> app_ea979460::FallibleError"] + 17 [ label = "app_ea979460::doubly_generic_error_handler(&app_ea979460::GenericError, &app_ea979460::Json) -> pavex::response::Response"] + 18 [ label = "app_ea979460::generic_error_handler(&app_ea979460::GenericError) -> pavex::response::Response"] + 19 [ label = "app_ea979460::generic_error_handler(&app_ea979460::GenericError) -> pavex::response::Response"] + 20 [ label = "app_ea979460::error_handler(&app_ea979460::FallibleError) -> pavex::response::Response"] + 21 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 22 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 23 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 24 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 25 [ label = "`match`"] + 26 [ label = "`match`"] + 27 [ label = "`match`"] + 28 [ label = "`match`"] + 7 -> 0 [ label = "&"] + 25 -> 13 [ ] + 6 -> 0 [ label = "&"] + 26 -> 14 [ ] + 5 -> 0 [ ] + 27 -> 15 [ ] + 4 -> 0 [ ] + 28 -> 16 [ ] + 3 -> 0 [ label = "&"] + 2 -> 0 [ ] + 1 -> 0 [ ] + 28 -> 4 [ ] + 27 -> 5 [ ] + 26 -> 6 [ ] + 25 -> 7 [ ] + 0 -> 12 [ ] + 16 -> 20 [ label = "&"] + 15 -> 19 [ label = "&"] + 14 -> 18 [ label = "&"] + 13 -> 17 [ label = "&"] + 1 -> 17 [ label = "&"] + 20 -> 24 [ ] + 19 -> 23 [ ] + 18 -> 22 [ ] + 17 -> 21 [ ] + 8 -> 25 [ ] + 9 -> 26 [ ] + 10 -> 27 [ ] + 11 -> 28 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/expectations/app.rs b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/expectations/app.rs rename to libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/expectations/diagnostics.dot b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml new file mode 100644 index 000000000..e18dff32b --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_ea979460" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_ea979460 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/blueprint.ron new file mode 100644 index 000000000..584e59a7b --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/blueprint.ron @@ -0,0 +1,149 @@ +( + creation_location: ( + line: 67, + column: 18, + file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ea979460", + module_path: "app_ea979460", + ), + import_path: "crate::json", + ), + location: ( + line: 68, + column: 8, + file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ea979460", + module_path: "app_ea979460", + ), + import_path: "crate::fallible", + ), + location: ( + line: 69, + column: 8, + file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_ea979460", + module_path: "app_ea979460", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 70, + column: 10, + file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", + ), + )), + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ea979460", + module_path: "app_ea979460", + ), + import_path: "crate::fallible_with_generic_error", + ), + location: ( + line: 71, + column: 8, + file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_ea979460", + module_path: "app_ea979460", + ), + import_path: "crate::generic_error_handler", + ), + location: ( + line: 72, + column: 10, + file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", + ), + )), + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ea979460", + module_path: "app_ea979460", + ), + import_path: "crate::fallible_with_generic_error2", + ), + location: ( + line: 73, + column: 8, + file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_ea979460", + module_path: "app_ea979460", + ), + import_path: "crate::doubly_generic_error_handler", + ), + location: ( + line: 74, + column: 10, + file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ea979460", + module_path: "app_ea979460", + ), + import_path: "crate::handler", + ), + location: ( + line: 75, + column: 8, + file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/src/lib.rs new file mode 100644 index 000000000..e785a9006 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/src/lib.rs @@ -0,0 +1,204 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_ea979460::fallible_with_generic_error2(); + let v1 = match v0 { + Ok(ok) => ok, + Err(v1) => { + return { + let v2 = app_ea979460::json(); + let v3 = app_ea979460::doubly_generic_error_handler(&v1, &v2); + ::into_response( + v3, + ) + }; + } + }; + let v2 = app_ea979460::fallible_with_generic_error(); + let v3 = match v2 { + Ok(ok) => ok, + Err(v3) => { + return { + let v4 = app_ea979460::generic_error_handler(&v3); + ::into_response( + v4, + ) + }; + } + }; + let v4 = app_ea979460::fallible_with_generic_error(); + let v5 = match v4 { + Ok(ok) => ok, + Err(v5) => { + return { + let v6 = app_ea979460::generic_error_handler(&v5); + ::into_response( + v6, + ) + }; + } + }; + let v6 = app_ea979460::fallible(); + let v7 = match v6 { + Ok(ok) => ok, + Err(v7) => { + return { + let v8 = app_ea979460::error_handler(&v7); + ::into_response( + v8, + ) + }; + } + }; + let v8 = app_ea979460::json(); + let v9 = app_ea979460::json(); + let v10 = app_ea979460::json(); + let v11 = app_ea979460::handler(v8, v10, &v9, v7, v5, &v3, &v1); + ::into_response(v11) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/lib.rs b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/lib.rs rename to libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/main.rs b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/main.rs new file mode 100644 index 000000000..b606d0961 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ea979460::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/test_config.toml b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/test_config.toml rename to libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/test_config.toml diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/.atomicwritevn0J69/tmpfile.tmp b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/.atomicwritevn0J69/tmpfile.tmp new file mode 100644 index 000000000..dbd17f67d --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/.atomicwritevn0J69/tmpfile.tmp @@ -0,0 +1,17 @@ +[package] +name = "app_6c44cec0" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies] +workspace_hack = { version = "0.1", path = "../../../workspace_hack" } + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/Cargo.toml b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/Cargo.toml new file mode 100644 index 000000000..5a5c5d07e --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_6c44cec0" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/expectations/stderr.txt b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/expectations/stderr.txt rename to libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/Cargo.toml new file mode 100644 index 000000000..b31ecb60c --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_6c44cec0" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/blueprint.ron new file mode 100644 index 000000000..00cd25558 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/blueprint.ron @@ -0,0 +1,83 @@ +( + creation_location: ( + line: 23, + column: 18, + file: "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_6c44cec0", + module_path: "app_6c44cec0", + ), + import_path: "crate::naked", + ), + location: ( + line: 24, + column: 8, + file: "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_6c44cec0", + module_path: "app_6c44cec0", + ), + import_path: "crate::fallible_naked", + ), + location: ( + line: 25, + column: 8, + file: "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_6c44cec0", + module_path: "app_6c44cec0", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 26, + column: 10, + file: "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_6c44cec0", + module_path: "app_6c44cec0", + ), + import_path: "crate::handler", + ), + location: ( + line: 27, + column: 8, + file: "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/lib.rs b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/lib.rs rename to libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/main.rs b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/main.rs new file mode 100644 index 000000000..9445bea43 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_6c44cec0::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/test_config.toml b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/test_config.toml rename to libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/test_config.toml diff --git a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/Cargo.toml b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/Cargo.toml new file mode 100644 index 000000000..9ac78271c --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_d0f81bc0" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/diagnostics.dot b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/diagnostics.dot new file mode 100644 index 000000000..1a8f23e28 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/diagnostics.dot @@ -0,0 +1,45 @@ +digraph "GET /handler - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0(&'static str) -> crate::route_0::Next0"] + 3 [ label = "&'static str"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /handler - 1" { + 0 [ label = "app_d0f81bc0::handler(&'static str) -> pavex::response::Response"] + 1 [ label = "&'static str"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* /handler - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /handler - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(&'static str) -> crate::ApplicationState"] + 1 [ label = "app_d0f81bc0::static_str() -> &'static str"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/static_references_are_valid_singletons/expectations/app.rs b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/static_references_are_valid_singletons/expectations/app.rs rename to libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/static_references_are_valid_singletons/expectations/diagnostics.dot b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/static_references_are_valid_singletons/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml new file mode 100644 index 000000000..6012553e6 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_d0f81bc0" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_d0f81bc0 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/blueprint.ron new file mode 100644 index 000000000..b80481b4b --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 13, + column: 18, + file: "blueprint/constructors/static_references_are_valid_singletons/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d0f81bc0", + module_path: "app_d0f81bc0", + ), + import_path: "crate::static_str", + ), + location: ( + line: 14, + column: 8, + file: "blueprint/constructors/static_references_are_valid_singletons/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/handler", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_d0f81bc0", + module_path: "app_d0f81bc0", + ), + import_path: "crate::handler", + ), + location: ( + line: 15, + column: 8, + file: "blueprint/constructors/static_references_are_valid_singletons/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/src/lib.rs new file mode 100644 index 000000000..971aa6635 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/src/lib.rs @@ -0,0 +1,158 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: &'static str, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_d0f81bc0::static_str(); + crate::ApplicationState { s0: v0 } +} +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("/handler", 0u32).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_1::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::GET => { + route_0::entrypoint(server_state.application_state.s0.clone()).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint(s_0: &'static str) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1(s_0: &'static str) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: &'static str) -> pavex::response::Response { + let v1 = crate::route_0::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: &'static str) -> pavex::response::Response { + let v1 = app_d0f81bc0::handler(v0); + ::into_response(v1) + } + struct Next0 + where + T: std::future::Future, + { + s_0: &'static str, + next: fn(&'static str) -> 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)(self.s_0) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/static_references_are_valid_singletons/lib.rs b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/static_references_are_valid_singletons/lib.rs rename to libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/src/lib.rs diff --git a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/src/main.rs b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/src/main.rs new file mode 100644 index 000000000..9a5df9de8 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_d0f81bc0::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/static_references_are_valid_singletons/test_config.toml b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/static_references_are_valid_singletons/test_config.toml rename to libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/test_config.toml diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/Cargo.toml b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/Cargo.toml new file mode 100644 index 000000000..f382473d7 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "app_55dca802" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.dep_55dca802] +path = "ephemeral_deps/dep" diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/diagnostics.dot b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/diagnostics.dot new file mode 100644 index 000000000..337f0a2aa --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/diagnostics.dot @@ -0,0 +1,41 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_55dca802::Streamer::stream_file(dep_55dca802::Logger) -> pavex::response::Response"] + 1 [ label = "dep_55dca802::new_logger() -> dep_55dca802::Logger"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/ephemeral_deps/dep/Cargo.toml b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/ephemeral_deps/dep/Cargo.toml new file mode 100644 index 000000000..743fa8c35 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/ephemeral_deps/dep/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "dep_55dca802" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[lints.rust.unused] +level = "allow" + +[dependencies.pavex] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/dep.rs b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/ephemeral_deps/dep/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/dep.rs rename to libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/ephemeral_deps/dep/src/lib.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/app.rs b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/app.rs similarity index 99% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/app.rs rename to libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/app.rs index e70ba3947..167248f5e 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/app.rs +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/app.rs @@ -84,7 +84,7 @@ pub mod route_0 { ::into_response(v2) } async fn handler() -> pavex::response::Response { - let v0 = dep::new_logger(); + let v0 = dep_55dca802::new_logger(); let v1 = app::Streamer::stream_file(v0); ::into_response(v1) } diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/diagnostics.dot b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/diagnostics.dot new file mode 100644 index 000000000..3226fb764 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/diagnostics.dot @@ -0,0 +1,41 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app::Streamer::stream_file(dep_55dca802::Logger) -> pavex::response::Response"] + 1 [ label = "dep_55dca802::new_logger() -> dep_55dca802::Logger"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml new file mode 100644 index 000000000..f559a997c --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "application_55dca802" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_55dca802 = { version = "0.1.0", path = ".." } +dep_55dca802 = { version = "0.1.0", path = "../ephemeral_deps/dep" } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/blueprint.ron new file mode 100644 index 000000000..4c136c468 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 13, + column: 18, + file: "blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_55dca802", + module_path: "app_55dca802", + ), + import_path: "dep_55dca802::new_logger", + ), + location: ( + line: 14, + column: 8, + file: "blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_55dca802", + module_path: "app_55dca802", + ), + import_path: "::dep_55dca802::new_logger", + ), + location: ( + line: 15, + column: 8, + file: "blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_55dca802", + module_path: "app_55dca802", + ), + import_path: "crate::Streamer::stream_file", + ), + location: ( + line: 16, + column: 8, + file: "blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/src/lib.rs new file mode 100644 index 000000000..49d972dbc --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/src/lib.rs @@ -0,0 +1,153 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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 = dep_55dca802::new_logger(); + let v1 = app_55dca802::Streamer::stream_file(v0); + ::into_response(v1) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/lib.rs b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/lib.rs similarity index 55% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/lib.rs rename to libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/lib.rs index 45c8d40f4..949261aa1 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/lib.rs +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/lib.rs @@ -4,15 +4,15 @@ use pavex::f; pub struct Streamer; impl Streamer { - pub fn stream_file(_logger: dep::Logger) -> pavex::response::Response { + pub fn stream_file(_logger: dep_55dca802::Logger) -> pavex::response::Response { todo!() } } pub fn blueprint() -> Blueprint { let mut bp = Blueprint::new(); - bp.constructor(f!(dep::new_logger), Lifecycle::Singleton); - bp.constructor(f!(::dep::new_logger), Lifecycle::RequestScoped); + bp.constructor(f!(dep_55dca802::new_logger), Lifecycle::Singleton); + bp.constructor(f!(::dep_55dca802::new_logger), Lifecycle::RequestScoped); bp.route(GET, "/home", f!(crate::Streamer::stream_file)); bp } diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/main.rs b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/main.rs new file mode 100644 index 000000000..87d429092 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_55dca802::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/test_config.toml b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/test_config.toml rename to libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/test_config.toml diff --git a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/Cargo.toml b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/Cargo.toml new file mode 100644 index 000000000..95a5e0af7 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_621e9d53" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/diagnostics.dot b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/diagnostics.dot new file mode 100644 index 000000000..5afe9f4a6 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/diagnostics.dot @@ -0,0 +1,41 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_621e9d53::Streamer::stream_file(app_621e9d53::Logger) -> pavex::response::Response"] + 1 [ label = "app_621e9d53::new_logger() -> app_621e9d53::Logger"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/expectations/app.rs b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/expectations/app.rs rename to libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/expectations/diagnostics.dot b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml new file mode 100644 index 000000000..ac6d28118 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_621e9d53" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_621e9d53 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/blueprint.ron new file mode 100644 index 000000000..44ae12191 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 19, + column: 18, + file: "blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_621e9d53", + module_path: "app_621e9d53", + ), + import_path: "crate::new_logger", + ), + location: ( + line: 20, + column: 8, + file: "blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_621e9d53", + module_path: "app_621e9d53", + ), + import_path: "crate::new_logger", + ), + location: ( + line: 21, + column: 8, + file: "blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_621e9d53", + module_path: "app_621e9d53", + ), + import_path: "crate::Streamer::stream_file", + ), + location: ( + line: 22, + column: 8, + file: "blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/src/lib.rs new file mode 100644 index 000000000..fcf338cba --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/src/lib.rs @@ -0,0 +1,153 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_621e9d53::new_logger(); + let v1 = app_621e9d53::Streamer::stream_file(v0); + ::into_response(v1) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/lib.rs b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/lib.rs rename to libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/lib.rs diff --git a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/main.rs b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/main.rs new file mode 100644 index 000000000..4cb2d5fd2 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_621e9d53::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/test_config.toml b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/test_config.toml rename to libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/test_config.toml diff --git a/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/Cargo.toml b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/Cargo.toml new file mode 100644 index 000000000..e4a04f8b0 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_c5885cdb" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/expectations/stderr.txt b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/expectations/stderr.txt rename to libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/Cargo.toml new file mode 100644 index 000000000..040b84049 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_c5885cdb" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/blueprint.ron new file mode 100644 index 000000000..d8c25f2fa --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 39, + column: 18, + file: "blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c5885cdb", + module_path: "app_c5885cdb", + ), + import_path: "crate::NonSendSingleton::new", + ), + location: ( + line: 40, + column: 8, + file: "blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c5885cdb", + module_path: "app_c5885cdb", + ), + import_path: "crate::NonSyncSingleton::new", + ), + location: ( + line: 41, + column: 8, + file: "blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c5885cdb", + module_path: "app_c5885cdb", + ), + import_path: "crate::handler", + ), + location: ( + line: 44, + column: 8, + file: "blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/lib.rs b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/lib.rs rename to libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs diff --git a/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/src/main.rs b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/src/main.rs new file mode 100644 index 000000000..d80d97cbd --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_c5885cdb::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/test_config.toml b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/test_config.toml rename to libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/test_config.toml diff --git a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/Cargo.toml b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/Cargo.toml new file mode 100644 index 000000000..748ade42d --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_46e3d1f1" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/diagnostics.dot b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/diagnostics.dot new file mode 100644 index 000000000..212afdb4c --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/diagnostics.dot @@ -0,0 +1,3 @@ +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/expectations/app.rs b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/expectations/app.rs rename to libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/expectations/diagnostics.dot b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml new file mode 100644 index 000000000..a04174fca --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "application_46e3d1f1" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/blueprint.ron new file mode 100644 index 000000000..e6a35b8a6 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/blueprint.ron @@ -0,0 +1,31 @@ +( + creation_location: ( + line: 13, + column: 18, + file: "blueprint/constructors/unused_constructor_warning_can_be_ignored/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_46e3d1f1", + module_path: "app_46e3d1f1", + ), + import_path: "crate::Unused::new", + ), + location: ( + line: 14, + column: 8, + file: "blueprint/constructors/unused_constructor_warning_can_be_ignored/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: { + Unused: Ignore, + }, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/src/lib.rs new file mode 100644 index 000000000..74f099cc2 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/src/lib.rs @@ -0,0 +1,101 @@ +//! 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 +} +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_0::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 { + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + 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_0::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/lib.rs b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/lib.rs rename to libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/src/lib.rs diff --git a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/src/main.rs b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/src/main.rs new file mode 100644 index 000000000..0c85f27a6 --- /dev/null +++ b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_46e3d1f1::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/test_config.toml b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/test_config.toml rename to libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/test_config.toml diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/Cargo.toml new file mode 100644 index 000000000..30c8dc21c --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_8e8ba674" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/expectations/stderr.txt b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/expectations/stderr.txt rename to libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/Cargo.toml new file mode 100644 index 000000000..b200a70cf --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_8e8ba674" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/blueprint.ron new file mode 100644 index 000000000..cb080f1a3 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/blueprint.ron @@ -0,0 +1,63 @@ +( + creation_location: ( + line: 22, + column: 18, + file: "blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_8e8ba674", + module_path: "app_8e8ba674", + ), + import_path: "crate::infallible_constructor", + ), + location: ( + line: 23, + column: 8, + file: "blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_8e8ba674", + module_path: "app_8e8ba674", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 24, + column: 10, + file: "blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_8e8ba674", + module_path: "app_8e8ba674", + ), + import_path: "crate::request_handler", + ), + location: ( + line: 25, + column: 8, + file: "blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/lib.rs b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/lib.rs rename to libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/lib.rs diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/main.rs b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/main.rs new file mode 100644 index 000000000..ea660c57c --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_8e8ba674::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/test_config.toml b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/test_config.toml rename to libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/test_config.toml diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/Cargo.toml new file mode 100644 index 000000000..524f6e7ed --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_c3c254cf" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/expectations/stderr.txt b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/expectations/stderr.txt rename to libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/Cargo.toml new file mode 100644 index 000000000..cbd0d024e --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_c3c254cf" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/blueprint.ron new file mode 100644 index 000000000..69fdd23f7 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/blueprint.ron @@ -0,0 +1,63 @@ +( + creation_location: ( + line: 22, + column: 18, + file: "blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c3c254cf", + module_path: "app_c3c254cf", + ), + import_path: "crate::infallible_constructor", + ), + location: ( + line: 23, + column: 8, + file: "blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_c3c254cf", + module_path: "app_c3c254cf", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 24, + column: 10, + file: "blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c3c254cf", + module_path: "app_c3c254cf", + ), + import_path: "crate::request_handler", + ), + location: ( + line: 25, + column: 8, + file: "blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/lib.rs b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/lib.rs rename to libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/lib.rs diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/main.rs b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/main.rs new file mode 100644 index 000000000..926a05c4b --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_c3c254cf::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/test_config.toml b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/test_config.toml rename to libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/test_config.toml diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/Cargo.toml new file mode 100644 index 000000000..86d2e704c --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_40a0f751" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/diagnostics.dot b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/diagnostics.dot new file mode 100644 index 000000000..efa6b9f08 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/diagnostics.dot @@ -0,0 +1,106 @@ +digraph "GET /with_observer - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_2::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_2::Next0() -> crate::route_2::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /with_observer - 1" { + 0 [ label = "app_40a0f751::handler(alloc::string::String) -> pavex::response::Response"] + 1 [ label = "core::prelude::rust_2015::Result -> alloc::string::String"] + 2 [ label = "app_40a0f751::fallible_constructor() -> core::prelude::rust_2015::Result"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "core::prelude::rust_2015::Result -> app_40a0f751::CustomError"] + 5 [ label = "pavex::Error::new(app_40a0f751::CustomError) -> pavex::Error"] + 6 [ label = "app_40a0f751::error_handler(&pavex::Error) -> pavex::response::Response"] + 7 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 8 [ label = "app_40a0f751::error_observer(&pavex::Error)"] + 9 [ label = "`match`"] + 1 -> 0 [ ] + 9 -> 4 [ ] + 9 -> 1 [ ] + 0 -> 3 [ ] + 4 -> 5 [ ] + 5 -> 6 [ label = "&"] + 6 -> 7 [ ] + 5 -> 8 [ label = "&"] + 8 -> 7 [ label = "happens before"] + 2 -> 9 [ ] +} + +digraph "* /with_observer - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /with_observer - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /without_observer - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /without_observer - 1" { + 0 [ label = "app_40a0f751::handler(alloc::string::String) -> pavex::response::Response"] + 1 [ label = "core::prelude::rust_2015::Result -> alloc::string::String"] + 2 [ label = "app_40a0f751::fallible_constructor() -> core::prelude::rust_2015::Result"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "core::prelude::rust_2015::Result -> app_40a0f751::CustomError"] + 5 [ label = "pavex::Error::new(app_40a0f751::CustomError) -> pavex::Error"] + 6 [ label = "app_40a0f751::error_handler(&pavex::Error) -> pavex::response::Response"] + 7 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 8 [ label = "`match`"] + 1 -> 0 [ ] + 8 -> 4 [ ] + 8 -> 1 [ ] + 0 -> 3 [ ] + 4 -> 5 [ ] + 5 -> 6 [ label = "&"] + 6 -> 7 [ ] + 2 -> 8 [ ] +} + +digraph "* /without_observer - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /without_observer - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/expectations/app.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/expectations/app.rs rename to libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/expectations/diagnostics.dot b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml new file mode 100644 index 000000000..b19f49076 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_40a0f751" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_40a0f751 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/blueprint.ron new file mode 100644 index 000000000..fbed8010b --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/blueprint.ron @@ -0,0 +1,117 @@ +( + creation_location: ( + line: 33, + column: 18, + file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_40a0f751", + module_path: "app_40a0f751", + ), + import_path: "crate::fallible_constructor", + ), + location: ( + line: 34, + column: 8, + file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_40a0f751", + module_path: "app_40a0f751", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 35, + column: 10, + file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/without_observer", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_40a0f751", + module_path: "app_40a0f751", + ), + import_path: "crate::handler", + ), + location: ( + line: 38, + column: 8, + file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", + ), + ), + error_handler: None, + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 41, + column: 22, + file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", + ), + components: [ + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_40a0f751", + module_path: "app_40a0f751", + ), + import_path: "crate::error_observer", + ), + location: ( + line: 42, + column: 12, + file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", + ), + ), + )), + Route(( + path: "/with_observer", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_40a0f751", + module_path: "app_40a0f751", + ), + import_path: "crate::handler", + ), + location: ( + line: 43, + column: 12, + file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 40, + column: 8, + file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/src/lib.rs new file mode 100644 index 000000000..9c15124a2 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/src/lib.rs @@ -0,0 +1,230 @@ +//! 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("/with_observer", 0u32).unwrap(); + router.insert("/without_observer", 1u32).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_1::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::GET => route_2::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + 1u32 => { + match &request_head.method { + &pavex::http::Method::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_40a0f751::fallible_constructor(); + let v1 = match v0 { + Ok(ok) => ok, + Err(v1) => { + return { + let v2 = pavex::Error::new(v1); + let v3 = app_40a0f751::error_handler(&v2); + ::into_response( + v3, + ) + }; + } + }; + let v2 = app_40a0f751::handler(v1); + ::into_response(v2) + } + 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<'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_1::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) + } + } +} +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_40a0f751::fallible_constructor(); + let v1 = match v0 { + Ok(ok) => ok, + Err(v1) => { + return { + let v2 = pavex::Error::new(v1); + let v3 = app_40a0f751::error_handler(&v2); + app_40a0f751::error_observer(&v2); + ::into_response( + v3, + ) + }; + } + }; + let v2 = app_40a0f751::handler(v1); + ::into_response(v2) + } + 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)() + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/lib.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/lib.rs rename to libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/main.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/main.rs new file mode 100644 index 000000000..aaba90699 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_40a0f751::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/test_config.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/test_config.toml rename to libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/test_config.toml diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/Cargo.toml new file mode 100644 index 000000000..543e12aa7 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_6e40e01f" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/expectations/stderr.txt b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/expectations/stderr.txt rename to libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/Cargo.toml new file mode 100644 index 000000000..a6a20684c --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_6e40e01f" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/blueprint.ron new file mode 100644 index 000000000..5e9fd6361 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/blueprint.ron @@ -0,0 +1,43 @@ +( + creation_location: ( + line: 14, + column: 18, + file: "blueprint/error_handlers/error_handlers_cannot_be_fallible/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_6e40e01f", + module_path: "app_6e40e01f", + ), + import_path: "crate::handler", + ), + location: ( + line: 15, + column: 8, + file: "blueprint/error_handlers/error_handlers_cannot_be_fallible/src/lib.rs", + ), + ), + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_6e40e01f", + module_path: "app_6e40e01f", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 16, + column: 10, + file: "blueprint/error_handlers/error_handlers_cannot_be_fallible/src/lib.rs", + ), + )), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/lib.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/lib.rs rename to libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/src/lib.rs diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/src/main.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/src/main.rs new file mode 100644 index 000000000..23f552333 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_6e40e01f::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/test_config.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/test_config.toml rename to libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/test_config.toml diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/Cargo.toml new file mode 100644 index 000000000..e697fd2b2 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_3fac62e4" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/expectations/stderr.txt b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/expectations/stderr.txt rename to libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/Cargo.toml new file mode 100644 index 000000000..8bdd5042d --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_3fac62e4" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/blueprint.ron new file mode 100644 index 000000000..f2cb0fe58 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/blueprint.ron @@ -0,0 +1,63 @@ +( + creation_location: ( + line: 21, + column: 18, + file: "blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_3fac62e4", + module_path: "app_3fac62e4", + ), + import_path: "crate::fallible_constructor", + ), + location: ( + line: 22, + column: 8, + file: "blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_3fac62e4", + module_path: "app_3fac62e4", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 23, + column: 10, + file: "blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_3fac62e4", + module_path: "app_3fac62e4", + ), + import_path: "crate::handler", + ), + location: ( + line: 24, + column: 8, + file: "blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/lib.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/lib.rs rename to libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/lib.rs diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/main.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/main.rs new file mode 100644 index 000000000..5a28090f9 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_3fac62e4::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/test_config.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/test_config.toml rename to libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/test_config.toml diff --git a/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/Cargo.toml new file mode 100644 index 000000000..ea569b3cd --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_51ea2925" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/expectations/stderr.txt b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/expectations/stderr.txt rename to libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/Cargo.toml new file mode 100644 index 000000000..af0200f4e --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_51ea2925" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/blueprint.ron new file mode 100644 index 000000000..28adffb61 --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/blueprint.ron @@ -0,0 +1,149 @@ +( + creation_location: ( + line: 51, + column: 18, + file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_51ea2925", + module_path: "app_51ea2925", + ), + import_path: "crate::generic_constructor", + ), + location: ( + line: 52, + column: 8, + file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_51ea2925", + module_path: "app_51ea2925", + ), + import_path: "crate::constructor1", + ), + location: ( + line: 53, + column: 8, + file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_51ea2925", + module_path: "app_51ea2925", + ), + import_path: "crate::generic_error_handler", + ), + location: ( + line: 54, + column: 10, + file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", + ), + )), + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_51ea2925", + module_path: "app_51ea2925", + ), + import_path: "crate::constructor2", + ), + location: ( + line: 55, + column: 8, + file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_51ea2925", + module_path: "app_51ea2925", + ), + import_path: "crate::doubly_generic_error_handler", + ), + location: ( + line: 56, + column: 10, + file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", + ), + )), + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_51ea2925", + module_path: "app_51ea2925", + ), + import_path: "crate::constructor3", + ), + location: ( + line: 57, + column: 8, + file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_51ea2925", + module_path: "app_51ea2925", + ), + import_path: "crate::triply_generic_error_handler", + ), + location: ( + line: 58, + column: 10, + file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_51ea2925", + module_path: "app_51ea2925", + ), + import_path: "crate::handler", + ), + location: ( + line: 59, + column: 8, + file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/lib.rs b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/lib.rs rename to libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs diff --git a/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/main.rs b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/main.rs new file mode 100644 index 000000000..57327d58a --- /dev/null +++ b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_51ea2925::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/test_config.toml b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/test_config.toml rename to libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/test_config.toml diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/Cargo.toml b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/Cargo.toml new file mode 100644 index 000000000..16d1fcf18 --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_a0da5eb4" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/expectations/stderr.txt b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/expectations/stderr.txt rename to libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/Cargo.toml new file mode 100644 index 000000000..83913450b --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_a0da5eb4" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/blueprint.ron new file mode 100644 index 000000000..87352c6db --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/blueprint.ron @@ -0,0 +1,57 @@ +( + creation_location: ( + line: 20, + column: 18, + file: "blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs", + ), + components: [ + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_a0da5eb4", + module_path: "app_a0da5eb4", + ), + import_path: "crate::generic", + ), + location: ( + line: 21, + column: 8, + file: "blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + )), + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_a0da5eb4", + module_path: "app_a0da5eb4", + ), + import_path: "crate::generic2", + ), + location: ( + line: 22, + column: 8, + file: "blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + )), + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_a0da5eb4", + module_path: "app_a0da5eb4", + ), + import_path: "crate::generic3", + ), + location: ( + line: 23, + column: 8, + file: "blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/lib.rs b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/lib.rs rename to libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/main.rs b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/main.rs new file mode 100644 index 000000000..dc638e558 --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_a0da5eb4::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/test_config.toml b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/test_config.toml rename to libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/test_config.toml diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/Cargo.toml b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/Cargo.toml new file mode 100644 index 000000000..731ac1dc3 --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_e31b3bf3" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/expectations/stderr.txt b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/expectations/stderr.txt rename to libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/Cargo.toml new file mode 100644 index 000000000..9b3e929ad --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_e31b3bf3" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/blueprint.ron new file mode 100644 index 000000000..3f78ee162 --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/blueprint.ron @@ -0,0 +1,25 @@ +( + creation_location: ( + line: 9, + column: 18, + file: "blueprint/error_observers/error_observers_must_return_the_unit_type/src/lib.rs", + ), + components: [ + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_e31b3bf3", + module_path: "app_e31b3bf3", + ), + import_path: "crate::error_observer", + ), + location: ( + line: 10, + column: 8, + file: "blueprint/error_observers/error_observers_must_return_the_unit_type/src/lib.rs", + ), + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/lib.rs b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/lib.rs rename to libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/src/lib.rs diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/src/main.rs b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/src/main.rs new file mode 100644 index 000000000..1257e48eb --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_e31b3bf3::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/test_config.toml b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/test_config.toml rename to libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/test_config.toml diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/Cargo.toml b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/Cargo.toml new file mode 100644 index 000000000..a01c4dd2b --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_8b77b4be" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/expectations/stderr.txt b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/expectations/stderr.txt rename to libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/Cargo.toml new file mode 100644 index 000000000..7dd9e6402 --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_8b77b4be" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/blueprint.ron new file mode 100644 index 000000000..d1decaf43 --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/blueprint.ron @@ -0,0 +1,25 @@ +( + creation_location: ( + line: 9, + column: 18, + file: "blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src/lib.rs", + ), + components: [ + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_8b77b4be", + module_path: "app_8b77b4be", + ), + import_path: "crate::error_observer", + ), + location: ( + line: 10, + column: 8, + file: "blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src/lib.rs", + ), + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/lib.rs b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/lib.rs rename to libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src/lib.rs diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src/main.rs b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src/main.rs new file mode 100644 index 000000000..91fce34a0 --- /dev/null +++ b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_8b77b4be::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/test_config.toml b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/test_config.toml rename to libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/test_config.toml diff --git a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/Cargo.toml b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/Cargo.toml new file mode 100644 index 000000000..58af1ab72 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_ea86e18a" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/diagnostics.dot b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/diagnostics.dot new file mode 100644 index 000000000..fb7e703ce --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/diagnostics.dot @@ -0,0 +1,89 @@ +digraph "GET /child - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_2::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_2::Next0(u32) -> crate::route_2::Next0"] + 3 [ label = "u32"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /child - 1" { + 0 [ label = "app_ea86e18a::nested_handler(u32) -> http::StatusCode"] + 1 [ label = "u32"] + 2 [ label = "::into_response(http::StatusCode) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* /child - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /child - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /parent - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0(u64) -> crate::route_0::Next0"] + 3 [ label = "u64"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /parent - 1" { + 0 [ label = "app_ea86e18a::parent_handler(u64) -> http::StatusCode"] + 1 [ label = "u64"] + 2 [ label = "::into_response(http::StatusCode) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* /parent - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /parent - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(u64, u32) -> crate::ApplicationState"] + 1 [ label = "app_ea86e18a::parent_singleton() -> u64"] + 2 [ label = "app_ea86e18a::nested_singleton(u16) -> u32"] + 3 [ label = "app_ea86e18a::singleton_dep() -> u16"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/expectations/app.rs b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/expectations/app.rs rename to libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/expectations/diagnostics.dot b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml new file mode 100644 index 000000000..20f2bd9b1 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_ea86e18a" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_ea86e18a = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/blueprint.ron new file mode 100644 index 000000000..f3035731e --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/blueprint.ron @@ -0,0 +1,128 @@ +( + creation_location: ( + line: 8, + column: 18, + file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ea86e18a", + module_path: "app_ea86e18a", + ), + import_path: "crate::parent_singleton", + ), + location: ( + line: 9, + column: 8, + file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/parent", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ea86e18a", + module_path: "app_ea86e18a", + ), + import_path: "crate::parent_handler", + ), + location: ( + line: 10, + column: 8, + file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", + ), + ), + error_handler: None, + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 24, + column: 18, + file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ea86e18a", + module_path: "app_ea86e18a", + ), + import_path: "crate::singleton_dep", + ), + location: ( + line: 25, + column: 8, + file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ea86e18a", + module_path: "app_ea86e18a", + ), + import_path: "crate::nested_singleton", + ), + location: ( + line: 26, + column: 8, + file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/child", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ea86e18a", + module_path: "app_ea86e18a", + ), + import_path: "crate::nested_handler", + ), + location: ( + line: 27, + column: 8, + file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 11, + column: 8, + file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/src/lib.rs new file mode 100644 index 000000000..cd6a26167 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/src/lib.rs @@ -0,0 +1,219 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: u64, + s1: u32, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_ea86e18a::singleton_dep(); + let v1 = app_ea86e18a::nested_singleton(v0); + let v2 = app_ea86e18a::parent_singleton(); + crate::ApplicationState { + s0: v2, + s1: v1, + } +} +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("/child", 0u32).unwrap(); + router.insert("/parent", 1u32).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_1::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::GET => { + route_2::entrypoint(server_state.application_state.s1.clone()).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + 1u32 => { + match &request_head.method { + &pavex::http::Method::GET => { + route_0::entrypoint(server_state.application_state.s0.clone()).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint(s_0: u64) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1(s_0: u64) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: u64) -> pavex::response::Response { + let v1 = crate::route_0::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: u64) -> pavex::response::Response { + let v1 = app_ea86e18a::parent_handler(v0); + ::into_response(v1) + } + struct Next0 + where + T: std::future::Future, + { + s_0: u64, + next: fn(u64) -> 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)(self.s_0) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} +pub mod route_2 { + pub async fn entrypoint(s_0: u32) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1(s_0: u32) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: u32) -> pavex::response::Response { + let v1 = crate::route_2::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: u32) -> pavex::response::Response { + let v1 = app_ea86e18a::nested_handler(v0); + ::into_response(v1) + } + struct Next0 + where + T: std::future::Future, + { + s_0: u32, + next: fn(u32) -> 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)(self.s_0) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/lib.rs b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/lib.rs rename to libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs diff --git a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/main.rs b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/main.rs new file mode 100644 index 000000000..536f37428 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ea86e18a::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/test_config.toml b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/test_config.toml rename to libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/test_config.toml diff --git a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/Cargo.toml b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/Cargo.toml new file mode 100644 index 000000000..2bc28791b --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_91e1ac20" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/diagnostics.dot b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/diagnostics.dot new file mode 100644 index 000000000..7628421d4 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/diagnostics.dot @@ -0,0 +1,45 @@ +digraph "GET /first/second/third/home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_1::Next0() -> crate::route_1::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /first/second/third/home - 1" { + 0 [ label = "app_91e1ac20::handler(alloc::string::String) -> http::StatusCode"] + 1 [ label = "app_91e1ac20::third(u32) -> alloc::string::String"] + 2 [ label = "app_91e1ac20::second(u16) -> u32"] + 3 [ label = "app_91e1ac20::first() -> u16"] + 4 [ label = "::into_response(http::StatusCode) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "* /first/second/third/home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a pavex::router::AllowedMethods) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /first/second/third/home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/expectations/app.rs b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/expectations/app.rs rename to libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/expectations/diagnostics.dot b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..7794a5ebe --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_91e1ac20" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_91e1ac20 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..d276acf1f --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/blueprint.ron @@ -0,0 +1,141 @@ +( + creation_location: ( + line: 8, + column: 18, + file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_91e1ac20", + module_path: "app_91e1ac20", + ), + import_path: "crate::first", + ), + location: ( + line: 9, + column: 8, + file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 15, + column: 18, + file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_91e1ac20", + module_path: "app_91e1ac20", + ), + import_path: "crate::second", + ), + location: ( + line: 16, + column: 8, + file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 22, + column: 18, + file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_91e1ac20", + module_path: "app_91e1ac20", + ), + import_path: "crate::third", + ), + location: ( + line: 23, + column: 8, + file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 29, + column: 18, + file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_91e1ac20", + module_path: "app_91e1ac20", + ), + import_path: "crate::handler", + ), + location: ( + line: 30, + column: 8, + file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: Some("/third"), + nesting_location: ( + line: 24, + column: 8, + file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", + ), + )), + ], + ), + path_prefix: Some("/second"), + nesting_location: ( + line: 17, + column: 8, + file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", + ), + )), + ], + ), + path_prefix: Some("/first"), + nesting_location: ( + line: 10, + column: 8, + file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..3628be1ee --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/src/lib.rs @@ -0,0 +1,155 @@ +//! 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("/first/second/third/home", 0u32).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_0::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::GET => route_1::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_0::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + 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_0::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) + } + } +} +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_91e1ac20::first(); + let v1 = app_91e1ac20::second(v0); + let v2 = app_91e1ac20::third(v1); + let v3 = app_91e1ac20::handler(v2); + ::into_response(v3) + } + 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)() + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/lib.rs b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/lib.rs rename to libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs diff --git a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/src/main.rs b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/src/main.rs new file mode 100644 index 000000000..6cc1f6358 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_91e1ac20::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/test_config.toml b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/test_config.toml rename to libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/test_config.toml diff --git a/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/Cargo.toml b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/Cargo.toml new file mode 100644 index 000000000..d6f715536 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_5f6d02ba" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/expectations/stderr.txt b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/expectations/stderr.txt rename to libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/Cargo.toml new file mode 100644 index 000000000..fbbc328dc --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_5f6d02ba" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/blueprint.ron new file mode 100644 index 000000000..95c2ee82f --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/blueprint.ron @@ -0,0 +1,57 @@ +( + creation_location: ( + line: 7, + column: 18, + file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", + ), + components: [ + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 19, + column: 5, + file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", + ), + components: [], + ), + path_prefix: Some(""), + nesting_location: ( + line: 9, + column: 8, + file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", + ), + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 19, + column: 5, + file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", + ), + components: [], + ), + path_prefix: Some("api"), + nesting_location: ( + line: 11, + column: 8, + file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", + ), + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 19, + column: 5, + file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", + ), + components: [], + ), + path_prefix: Some("/api/"), + nesting_location: ( + line: 13, + column: 8, + file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/lib.rs b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/lib.rs rename to libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs diff --git a/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/src/main.rs b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/src/main.rs new file mode 100644 index 000000000..ad8e08973 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_5f6d02ba::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/test_config.toml b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/test_config.toml rename to libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/test_config.toml diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/Cargo.toml b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/Cargo.toml new file mode 100644 index 000000000..534d712f7 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_309371bf" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/expectations/stderr.txt b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/expectations/stderr.txt rename to libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/Cargo.toml new file mode 100644 index 000000000..02dbfa0ec --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_309371bf" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/blueprint.ron new file mode 100644 index 000000000..f90eeff0d --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/blueprint.ron @@ -0,0 +1,108 @@ +( + creation_location: ( + line: 8, + column: 18, + file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_309371bf", + module_path: "app_309371bf", + ), + import_path: "crate::singleton", + ), + location: ( + line: 9, + column: 8, + file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/parent", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_309371bf", + module_path: "app_309371bf", + ), + import_path: "crate::handler", + ), + location: ( + line: 10, + column: 8, + file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", + ), + ), + error_handler: None, + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 28, + column: 18, + file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_309371bf", + module_path: "app_309371bf", + ), + import_path: "crate::overridden_singleton", + ), + location: ( + line: 29, + column: 8, + file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/child", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_309371bf", + module_path: "app_309371bf", + ), + import_path: "crate::handler", + ), + location: ( + line: 30, + column: 8, + file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 11, + column: 8, + file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/lib.rs b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/lib.rs rename to libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/main.rs b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/main.rs new file mode 100644 index 000000000..407173b4b --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_309371bf::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/test_config.toml b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/test_config.toml rename to libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/test_config.toml diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/Cargo.toml b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/Cargo.toml new file mode 100644 index 000000000..965c911af --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_de592621" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/expectations/stderr.txt b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/expectations/stderr.txt rename to libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/Cargo.toml new file mode 100644 index 000000000..d78552202 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_de592621" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/blueprint.ron new file mode 100644 index 000000000..ad1e438f2 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/blueprint.ron @@ -0,0 +1,108 @@ +( + creation_location: ( + line: 8, + column: 18, + file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_de592621", + module_path: "app_de592621", + ), + import_path: "crate::singleton", + ), + location: ( + line: 9, + column: 8, + file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/parent", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_de592621", + module_path: "app_de592621", + ), + import_path: "crate::handler", + ), + location: ( + line: 10, + column: 8, + file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", + ), + ), + error_handler: None, + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 24, + column: 18, + file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_de592621", + module_path: "app_de592621", + ), + import_path: "crate::singleton", + ), + location: ( + line: 25, + column: 8, + file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/child", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_de592621", + module_path: "app_de592621", + ), + import_path: "crate::handler", + ), + location: ( + line: 26, + column: 8, + file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 11, + column: 8, + file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/lib.rs b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/lib.rs rename to libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/main.rs b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/main.rs new file mode 100644 index 000000000..44555fc25 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_de592621::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/test_config.toml b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/test_config.toml rename to libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/test_config.toml diff --git a/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/Cargo.toml b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/Cargo.toml new file mode 100644 index 000000000..c995c32ec --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_ae32f1c9" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/expectations/stderr.txt b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/expectations/stderr.txt rename to libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/Cargo.toml new file mode 100644 index 000000000..1a4ecfc04 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_ae32f1c9" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/blueprint.ron new file mode 100644 index 000000000..b0ada944d --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/blueprint.ron @@ -0,0 +1,128 @@ +( + creation_location: ( + line: 8, + column: 18, + file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", + ), + components: [ + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 31, + column: 18, + file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ae32f1c9", + module_path: "app_ae32f1c9", + ), + import_path: "crate::singleton", + ), + location: ( + line: 32, + column: 8, + file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ae32f1c9", + module_path: "app_ae32f1c9", + ), + import_path: "crate::scoped", + ), + location: ( + line: 33, + column: 8, + file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ae32f1c9", + module_path: "app_ae32f1c9", + ), + import_path: "crate::transient", + ), + location: ( + line: 34, + column: 8, + file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/child", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ae32f1c9", + module_path: "app_ae32f1c9", + ), + import_path: "crate::handler", + ), + location: ( + line: 35, + column: 8, + file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 9, + column: 8, + file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", + ), + )), + Route(( + path: "/parent", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ae32f1c9", + module_path: "app_ae32f1c9", + ), + import_path: "crate::handler", + ), + location: ( + line: 10, + column: 8, + file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/lib.rs b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/lib.rs rename to libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs diff --git a/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/main.rs b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/main.rs new file mode 100644 index 000000000..34dfde4e0 --- /dev/null +++ b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ae32f1c9::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/test_config.toml b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/test_config.toml rename to libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/test_config.toml diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/Cargo.toml new file mode 100644 index 000000000..ebf9bf92d --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_466ed127" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/expectations/stderr.txt b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/expectations/stderr.txt rename to libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/Cargo.toml new file mode 100644 index 000000000..606770356 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_466ed127" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/blueprint.ron b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/blueprint.ron new file mode 100644 index 000000000..1f20fdc01 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/blueprint.ron @@ -0,0 +1,47 @@ +( + creation_location: ( + line: 14, + column: 18, + file: "blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/lib.rs", + ), + components: [ + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_466ed127", + module_path: "app_466ed127", + ), + import_path: "crate::mw", + ), + location: ( + line: 15, + column: 8, + file: "blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_466ed127", + module_path: "app_466ed127", + ), + import_path: "crate::handler", + ), + location: ( + line: 16, + column: 8, + file: "blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/lib.rs rename to libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/lib.rs diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/main.rs b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/main.rs new file mode 100644 index 000000000..920af4fb3 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_466ed127::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/test_config.toml b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/test_config.toml rename to libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/test_config.toml diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/Cargo.toml new file mode 100644 index 000000000..b38932e89 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_41064ffa" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/diagnostics.dot b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/diagnostics.dot new file mode 100644 index 000000000..c54a14910 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/diagnostics.dot @@ -0,0 +1,105 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0(app_41064ffa::A) -> crate::route_0::Next0"] + 3 [ label = "app_41064ffa::a() -> app_41064ffa::A"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_41064ffa::handler(&mut app_41064ffa::A) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&mut app_41064ffa::A"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /home - 2" { + 0 [ label = "app_41064ffa::first(pavex::response::Response, &mut app_41064ffa::A) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&mut app_41064ffa::A"] + 1 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "GET /home - 3" { + 0 [ label = "app_41064ffa::second(pavex::response::Response, &mut app_41064ffa::A) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&mut app_41064ffa::A"] + 1 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "GET /home - 4" { + 0 [ label = "app_41064ffa::third(pavex::response::Response, app_41064ffa::A) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 2 [ label = "app_41064ffa::A"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 0 [ ] + 0 -> 3 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(app_41064ffa::A, &'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 3 [ label = "app_41064ffa::a() -> app_41064ffa::A"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 5 [ ] + 6 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* /home - 2" { + 0 [ label = "app_41064ffa::first(pavex::response::Response, &mut app_41064ffa::A) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&mut app_41064ffa::A"] + 1 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "* /home - 3" { + 0 [ label = "app_41064ffa::second(pavex::response::Response, &mut app_41064ffa::A) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&mut app_41064ffa::A"] + 1 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "* /home - 4" { + 0 [ label = "app_41064ffa::third(pavex::response::Response, app_41064ffa::A) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 2 [ label = "app_41064ffa::A"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 0 [ ] + 0 -> 3 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/expectations/app.rs b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/expectations/app.rs rename to libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/expectations/diagnostics.dot b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml new file mode 100644 index 000000000..1f877ed5d --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_41064ffa" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_41064ffa = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/blueprint.ron b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/blueprint.ron new file mode 100644 index 000000000..5a4789225 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/blueprint.ron @@ -0,0 +1,101 @@ +( + creation_location: ( + line: 28, + column: 18, + file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_41064ffa", + module_path: "app_41064ffa", + ), + import_path: "crate::a", + ), + location: ( + line: 29, + column: 8, + file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_41064ffa", + module_path: "app_41064ffa", + ), + import_path: "crate::first", + ), + location: ( + line: 30, + column: 8, + file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_41064ffa", + module_path: "app_41064ffa", + ), + import_path: "crate::second", + ), + location: ( + line: 31, + column: 8, + file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_41064ffa", + module_path: "app_41064ffa", + ), + import_path: "crate::third", + ), + location: ( + line: 32, + column: 8, + file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_41064ffa", + module_path: "app_41064ffa", + ), + import_path: "crate::handler", + ), + location: ( + line: 33, + column: 8, + file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/src/lib.rs new file mode 100644 index 000000000..b919217b5 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/src/lib.rs @@ -0,0 +1,207 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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(mut s_0: app_41064ffa::A) -> pavex::response::Response { + let response = handler(&mut s_0).await; + let response = post_processing_0(response, &mut s_0).await; + let response = post_processing_1(response, &mut s_0).await; + let response = post_processing_2(response, s_0).await; + response + } + async fn wrapping_0() -> pavex::response::Response { + let v0 = app_41064ffa::a(); + let v1 = crate::route_0::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: &mut app_41064ffa::A) -> pavex::response::Response { + let v1 = app_41064ffa::handler(v0); + ::into_response(v1) + } + async fn post_processing_0( + v0: pavex::response::Response, + v1: &mut app_41064ffa::A, + ) -> pavex::response::Response { + let v2 = app_41064ffa::first(v0, v1); + ::into_response(v2) + } + async fn post_processing_1( + v0: pavex::response::Response, + v1: &mut app_41064ffa::A, + ) -> pavex::response::Response { + let v2 = app_41064ffa::second(v0, v1); + ::into_response(v2) + } + async fn post_processing_2( + v0: pavex::response::Response, + v1: app_41064ffa::A, + ) -> pavex::response::Response { + let v2 = app_41064ffa::third(v0, v1); + ::into_response(v2) + } + struct Next0 + where + T: std::future::Future, + { + s_0: app_41064ffa::A, + next: fn(app_41064ffa::A) -> 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)(self.s_0) + } + } +} +pub mod route_1 { + 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>( + mut s_0: app_41064ffa::A, + s_1: &'a pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let response = handler(s_1).await; + let response = post_processing_0(response, &mut s_0).await; + let response = post_processing_1(response, &mut s_0).await; + let response = post_processing_2(response, s_0).await; + response + } + async fn wrapping_0( + v0: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v1 = app_41064ffa::a(); + let v2 = crate::route_1::Next0 { + s_0: v1, + s_1: v0, + next: stage_1, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = pavex::middleware::wrap_noop(v3).await; + ::into_response(v4) + } + async fn handler(v0: &pavex::router::AllowedMethods) -> pavex::response::Response { + let v1 = pavex::router::default_fallback(v0).await; + ::into_response(v1) + } + async fn post_processing_0( + v0: pavex::response::Response, + v1: &mut app_41064ffa::A, + ) -> pavex::response::Response { + let v2 = app_41064ffa::first(v0, v1); + ::into_response(v2) + } + async fn post_processing_1( + v0: pavex::response::Response, + v1: &mut app_41064ffa::A, + ) -> pavex::response::Response { + let v2 = app_41064ffa::second(v0, v1); + ::into_response(v2) + } + async fn post_processing_2( + v0: pavex::response::Response, + v1: app_41064ffa::A, + ) -> pavex::response::Response { + let v2 = app_41064ffa::third(v0, v1); + ::into_response(v2) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: app_41064ffa::A, + s_1: &'a pavex::router::AllowedMethods, + next: fn(app_41064ffa::A, &'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, self.s_1) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/lib.rs rename to libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/src/main.rs b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/src/main.rs new file mode 100644 index 000000000..3abfb8f0a --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_41064ffa::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/test_config.toml b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/test_config.toml rename to libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/test_config.toml diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/Cargo.toml new file mode 100644 index 000000000..297d8db91 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_4a62f10c" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/expectations/stderr.txt b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/expectations/stderr.txt rename to libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/Cargo.toml new file mode 100644 index 000000000..bd8b965f2 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_4a62f10c" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/blueprint.ron b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/blueprint.ron new file mode 100644 index 000000000..9efc5370e --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/blueprint.ron @@ -0,0 +1,47 @@ +( + creation_location: ( + line: 14, + column: 18, + file: "blueprint/post_processing_middlewares/must_take_response_as_input/src/lib.rs", + ), + components: [ + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_4a62f10c", + module_path: "app_4a62f10c", + ), + import_path: "crate::mw", + ), + location: ( + line: 15, + column: 8, + file: "blueprint/post_processing_middlewares/must_take_response_as_input/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_4a62f10c", + module_path: "app_4a62f10c", + ), + import_path: "crate::handler", + ), + location: ( + line: 16, + column: 8, + file: "blueprint/post_processing_middlewares/must_take_response_as_input/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/lib.rs rename to libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/src/lib.rs diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/src/main.rs b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/src/main.rs new file mode 100644 index 000000000..b414809c9 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_4a62f10c::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/test_config.toml b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/test_config.toml rename to libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/test_config.toml diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/Cargo.toml new file mode 100644 index 000000000..775a42ec1 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_c8000fe9" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/diagnostics.dot b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/diagnostics.dot new file mode 100644 index 000000000..2794c5f2c --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/diagnostics.dot @@ -0,0 +1,55 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_c8000fe9::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "GET /home - 2" { + 0 [ label = "app_c8000fe9::mw(pavex::response::Response) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* /home - 2" { + 0 [ label = "app_c8000fe9::mw(pavex::response::Response) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/expectations/app.rs b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/expectations/app.rs rename to libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/expectations/diagnostics.dot b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml new file mode 100644 index 000000000..0fcbff93d --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_c8000fe9" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_c8000fe9 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/blueprint.ron b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/blueprint.ron new file mode 100644 index 000000000..8e148347a --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/blueprint.ron @@ -0,0 +1,47 @@ +( + creation_location: ( + line: 14, + column: 18, + file: "blueprint/post_processing_middlewares/post_process_without_wrapping/src/lib.rs", + ), + components: [ + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_c8000fe9", + module_path: "app_c8000fe9", + ), + import_path: "crate::mw", + ), + location: ( + line: 15, + column: 8, + file: "blueprint/post_processing_middlewares/post_process_without_wrapping/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c8000fe9", + module_path: "app_c8000fe9", + ), + import_path: "crate::handler", + ), + location: ( + line: 16, + column: 8, + file: "blueprint/post_processing_middlewares/post_process_without_wrapping/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/src/lib.rs new file mode 100644 index 000000000..c8a5556e4 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/src/lib.rs @@ -0,0 +1,166 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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; + let response = post_processing_0(response).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_c8000fe9::handler(); + ::into_response(v0) + } + async fn post_processing_0( + v0: pavex::response::Response, + ) -> pavex::response::Response { + let v1 = app_c8000fe9::mw(v0); + ::into_response(v1) + } + 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<'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; + let response = post_processing_0(response).await; + response + } + async fn wrapping_0( + v0: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v1 = crate::route_1::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) + } + async fn post_processing_0( + v0: pavex::response::Response, + ) -> pavex::response::Response { + let v1 = app_c8000fe9::mw(v0); + ::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/lib.rs rename to libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/src/lib.rs diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/src/main.rs b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/src/main.rs new file mode 100644 index 000000000..c84a2a6f4 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_c8000fe9::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/test_config.toml b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/test_config.toml rename to libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/test_config.toml diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/Cargo.toml new file mode 100644 index 000000000..50435dc48 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_59d05850" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt rename to libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml new file mode 100644 index 000000000..32d31a1f6 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_59d05850" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron new file mode 100644 index 000000000..0660c3924 --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron @@ -0,0 +1,81 @@ +( + creation_location: ( + line: 34, + column: 18, + file: "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + components: [ + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_59d05850", + module_path: "app_59d05850", + ), + import_path: "crate::generic", + ), + location: ( + line: 35, + column: 8, + file: "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_59d05850", + module_path: "app_59d05850", + ), + import_path: "crate::doubly_generic", + ), + location: ( + line: 36, + column: 8, + file: "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_59d05850", + module_path: "app_59d05850", + ), + import_path: "crate::triply_generic", + ), + location: ( + line: 37, + column: 8, + file: "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_59d05850", + module_path: "app_59d05850", + ), + import_path: "crate::handler", + ), + location: ( + line: 38, + column: 8, + file: "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/lib.rs rename to libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/main.rs b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/main.rs new file mode 100644 index 000000000..7f946015b --- /dev/null +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_59d05850::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/test_config.toml b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/test_config.toml rename to libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/test_config.toml diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/Cargo.toml b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/Cargo.toml new file mode 100644 index 000000000..78ba072b4 --- /dev/null +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_8ac65a81" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/diagnostics.dot b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/diagnostics.dot new file mode 100644 index 000000000..8ea7f5f36 --- /dev/null +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/diagnostics.dot @@ -0,0 +1,47 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_8ac65a81::pre() -> pavex::middleware::Processing"] +} + +digraph "GET /home - 2" { + 0 [ label = "app_8ac65a81::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "app_8ac65a81::pre() -> pavex::middleware::Processing"] +} + +digraph "* /home - 2" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/expectations/app.rs b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/expectations/app.rs rename to libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/expectations/diagnostics.dot b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml new file mode 100644 index 000000000..61aa1ff0e --- /dev/null +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_8ac65a81" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_8ac65a81 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/blueprint.ron b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/blueprint.ron new file mode 100644 index 000000000..e59a78af3 --- /dev/null +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/blueprint.ron @@ -0,0 +1,47 @@ +( + creation_location: ( + line: 15, + column: 18, + file: "blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/lib.rs", + ), + components: [ + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_8ac65a81", + module_path: "app_8ac65a81", + ), + import_path: "crate::pre", + ), + location: ( + line: 16, + column: 8, + file: "blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_8ac65a81", + module_path: "app_8ac65a81", + ), + import_path: "crate::handler", + ), + location: ( + line: 17, + column: 8, + file: "blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/src/lib.rs b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/src/lib.rs new file mode 100644 index 000000000..9886dbc2b --- /dev/null +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/src/lib.rs @@ -0,0 +1,168 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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 { + if let Some(response) = pre_processing_0().await.into_response() { + return 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 pre_processing_0() -> pavex::middleware::Processing< + pavex::response::Response, + > { + app_8ac65a81::pre() + } + async fn handler() -> pavex::response::Response { + let v0 = app_8ac65a81::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<'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 { + if let Some(response) = pre_processing_0().await.into_response() { + return response; + } + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v1 = crate::route_1::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 pre_processing_0() -> pavex::middleware::Processing< + pavex::response::Response, + > { + app_8ac65a81::pre() + } + 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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/lib.rs b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/lib.rs rename to libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/lib.rs diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/main.rs b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/main.rs new file mode 100644 index 000000000..6817f38cb --- /dev/null +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_8ac65a81::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/test_config.toml b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/test_config.toml rename to libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/test_config.toml diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/Cargo.toml b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/Cargo.toml new file mode 100644 index 000000000..89c0e7512 --- /dev/null +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_b3516518" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt rename to libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml new file mode 100644 index 000000000..ef038b5f1 --- /dev/null +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_b3516518" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron new file mode 100644 index 000000000..ab3520072 --- /dev/null +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron @@ -0,0 +1,81 @@ +( + creation_location: ( + line: 29, + column: 18, + file: "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + components: [ + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_b3516518", + module_path: "app_b3516518", + ), + import_path: "crate::generic", + ), + location: ( + line: 30, + column: 8, + file: "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_b3516518", + module_path: "app_b3516518", + ), + import_path: "crate::doubly_generic", + ), + location: ( + line: 31, + column: 8, + file: "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_b3516518", + module_path: "app_b3516518", + ), + import_path: "crate::triply_generic", + ), + location: ( + line: 32, + column: 8, + file: "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_b3516518", + module_path: "app_b3516518", + ), + import_path: "crate::handler", + ), + location: ( + line: 33, + column: 8, + file: "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/lib.rs b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/lib.rs rename to libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/main.rs b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/main.rs new file mode 100644 index 000000000..4dfc3970f --- /dev/null +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_b3516518::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/test_config.toml b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/test_config.toml rename to libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/test_config.toml diff --git a/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/Cargo.toml new file mode 100644 index 000000000..4c0c59e2e --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_9d0a5748" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/app.rs b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/app.rs rename to libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/diagnostics.dot b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/stderr.txt b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/stderr.txt rename to libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/Cargo.toml new file mode 100644 index 000000000..35b424cf8 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_9d0a5748" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/blueprint.ron b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/blueprint.ron new file mode 100644 index 000000000..9ac94854a --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/blueprint.ron @@ -0,0 +1,98 @@ +( + creation_location: ( + line: 28, + column: 18, + file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", + ), + components: [ + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_9d0a5748", + module_path: "app_9d0a5748", + ), + import_path: "crate::A", + ), + location: ( + line: 29, + column: 8, + file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_9d0a5748", + module_path: "app_9d0a5748", + ), + import_path: "crate::B", + ), + location: ( + line: 30, + column: 8, + file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_9d0a5748", + module_path: "app_9d0a5748", + ), + import_path: "crate::C", + ), + location: ( + line: 31, + column: 8, + file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_9d0a5748", + module_path: "app_9d0a5748", + ), + import_path: "crate::D", + ), + location: ( + line: 32, + column: 8, + file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_9d0a5748", + module_path: "app_9d0a5748", + ), + import_path: "crate::handler", + ), + location: ( + line: 33, + column: 8, + file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/lib.rs b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/lib.rs rename to libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/src/lib.rs diff --git a/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/src/main.rs b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/src/main.rs new file mode 100644 index 000000000..708cec32b --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_9d0a5748::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/test_config.toml b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/invalid_prebuilt/test_config.toml rename to libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/test_config.toml diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/Cargo.toml new file mode 100644 index 000000000..c877f8a1e --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_776ff188" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/diagnostics.dot b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/diagnostics.dot new file mode 100644 index 000000000..add85f453 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/diagnostics.dot @@ -0,0 +1,47 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a app_776ff188::B) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_776ff188::B"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_776ff188::handler(&app_776ff188::B) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&app_776ff188::B"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_776ff188::B) -> crate::ApplicationState"] + 1 [ label = "app_776ff188::b(app_776ff188::A) -> app_776ff188::B"] + 2 [ label = "app_776ff188::A"] + 1 -> 0 [ ] + 2 -> 1 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/expectations/app.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/expectations/app.rs rename to libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/expectations/diagnostics.dot b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml new file mode 100644 index 000000000..c1f24740e --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_776ff188" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_776ff188 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/blueprint.ron b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/blueprint.ron new file mode 100644 index 000000000..900ce486a --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/blueprint.ron @@ -0,0 +1,67 @@ +( + creation_location: ( + line: 20, + column: 18, + file: "blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/lib.rs", + ), + components: [ + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_776ff188", + module_path: "app_776ff188", + ), + import_path: "crate::A", + ), + location: ( + line: 21, + column: 8, + file: "blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_776ff188", + module_path: "app_776ff188", + ), + import_path: "crate::b", + ), + location: ( + line: 22, + column: 8, + file: "blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_776ff188", + module_path: "app_776ff188", + ), + import_path: "crate::handler", + ), + location: ( + line: 23, + column: 8, + file: "blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/src/lib.rs new file mode 100644 index 000000000..ce7571aa5 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/src/lib.rs @@ -0,0 +1,158 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_776ff188::B, +} +pub async fn build_application_state(v0: app_776ff188::A) -> crate::ApplicationState { + let v1 = app_776ff188::b(v0); + crate::ApplicationState { s0: v1 } +} +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("/", 0u32).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_1::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::GET => { + route_0::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>(s_0: &'a app_776ff188::B) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>(s_0: &'a app_776ff188::B) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: &app_776ff188::B) -> pavex::response::Response { + let v1 = crate::route_0::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: &app_776ff188::B) -> pavex::response::Response { + let v1 = app_776ff188::handler(v0); + ::into_response(v1) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_776ff188::B, + next: fn(&'a app_776ff188::B) -> 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) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/lib.rs rename to libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/lib.rs diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/main.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/main.rs new file mode 100644 index 000000000..56fc1981d --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_776ff188::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/test_config.toml b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/test_config.toml rename to libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/test_config.toml diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/Cargo.toml new file mode 100644 index 000000000..4c2890f36 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_e4a8214b" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/diagnostics.dot b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/diagnostics.dot new file mode 100644 index 000000000..46f9a541a --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/diagnostics.dot @@ -0,0 +1,63 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a, 'b>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a app_e4a8214b::B, app_e4a8214b::C<'static>, alloc::vec::Vec, &'b app_e4a8214b::A) -> crate::route_0::Next0<'a, 'b>"] + 3 [ label = "&app_e4a8214b::A"] + 4 [ label = "app_e4a8214b::C<'static>"] + 5 [ label = "alloc::vec::Vec"] + 7 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 8 [ label = "&app_e4a8214b::B"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 5 -> 2 [ ] + 4 -> 2 [ ] + 3 -> 2 [ ] + 0 -> 7 [ ] + 8 -> 2 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_e4a8214b::handler(&app_e4a8214b::A, &app_e4a8214b::B, app_e4a8214b::C<'static>, alloc::vec::Vec) -> pavex::response::Response"] + 1 [ label = "&app_e4a8214b::B"] + 3 [ label = "app_e4a8214b::C<'static>"] + 4 [ label = "alloc::vec::Vec"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&app_e4a8214b::A"] + 4 -> 0 [ ] + 3 -> 0 [ ] + 1 -> 0 [ ] + 0 -> 5 [ ] + 6 -> 0 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_e4a8214b::A, app_e4a8214b::C<'static>, alloc::vec::Vec, app_e4a8214b::B) -> crate::ApplicationState"] + 1 [ label = "app_e4a8214b::A"] + 2 [ label = "app_e4a8214b::C<'static>"] + 3 [ label = "alloc::vec::Vec"] + 4 [ label = "app_e4a8214b::B"] + 4 -> 0 [ ] + 3 -> 0 [ ] + 2 -> 0 [ ] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_works/expectations/app.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_works/expectations/app.rs rename to libs/ui_tests/blueprint/prebuilts/prebuilt_works/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_works/expectations/diagnostics.dot b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_works/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/prebuilts/prebuilt_works/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml new file mode 100644 index 000000000..6b4c9e6bd --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_e4a8214b" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_e4a8214b = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/blueprint.ron b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/blueprint.ron new file mode 100644 index 000000000..5121a58f1 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/blueprint.ron @@ -0,0 +1,98 @@ +( + creation_location: ( + line: 19, + column: 18, + file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", + ), + components: [ + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_e4a8214b", + module_path: "app_e4a8214b", + ), + import_path: "crate::A", + ), + location: ( + line: 20, + column: 8, + file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_e4a8214b", + module_path: "app_e4a8214b", + ), + import_path: "crate::B", + ), + location: ( + line: 21, + column: 8, + file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_e4a8214b", + module_path: "app_e4a8214b", + ), + import_path: "crate::C<\'static>", + ), + location: ( + line: 22, + column: 8, + file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", + ), + ), + cloning_strategy: Some(CloneIfNecessary), + )), + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_e4a8214b", + module_path: "app_e4a8214b", + ), + import_path: "std::vec::Vec", + ), + location: ( + line: 23, + column: 8, + file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", + ), + ), + cloning_strategy: Some(CloneIfNecessary), + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_e4a8214b", + module_path: "app_e4a8214b", + ), + import_path: "crate::handler", + ), + location: ( + line: 25, + column: 8, + file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/src/lib.rs new file mode 100644 index 000000000..eee6b3104 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/src/lib.rs @@ -0,0 +1,207 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_e4a8214b::A, + s1: app_e4a8214b::C<'static>, + s2: alloc::vec::Vec, + s3: app_e4a8214b::B, +} +pub async fn build_application_state( + v0: app_e4a8214b::A, + v1: app_e4a8214b::C<'static>, + v2: alloc::vec::Vec, + v3: app_e4a8214b::B, +) -> crate::ApplicationState { + crate::ApplicationState { + s0: v0, + s1: v1, + s2: v2, + s3: v3, + } +} +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("/", 0u32).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_1::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::GET => { + route_0::entrypoint( + &server_state.application_state.s0, + server_state.application_state.s1.clone(), + server_state.application_state.s2.clone(), + &server_state.application_state.s3, + ) + .await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a, 'b>( + s_0: &'a app_e4a8214b::A, + s_1: app_e4a8214b::C<'static>, + s_2: alloc::vec::Vec, + s_3: &'b app_e4a8214b::B, + ) -> pavex::response::Response { + let response = wrapping_0(s_0, s_1, s_2, s_3).await; + response + } + async fn stage_1<'a, 'b>( + s_0: &'a app_e4a8214b::B, + s_1: app_e4a8214b::C<'static>, + s_2: alloc::vec::Vec, + s_3: &'b app_e4a8214b::A, + ) -> pavex::response::Response { + let response = handler(s_0, s_1, s_2, s_3).await; + response + } + async fn wrapping_0( + v0: &app_e4a8214b::A, + v1: app_e4a8214b::C<'static>, + v2: alloc::vec::Vec, + v3: &app_e4a8214b::B, + ) -> pavex::response::Response { + let v4 = crate::route_0::Next0 { + s_0: v3, + s_1: v1, + s_2: v2, + s_3: v0, + next: stage_1, + }; + let v5 = pavex::middleware::Next::new(v4); + let v6 = pavex::middleware::wrap_noop(v5).await; + ::into_response(v6) + } + async fn handler( + v0: &app_e4a8214b::B, + v1: app_e4a8214b::C<'static>, + v2: alloc::vec::Vec, + v3: &app_e4a8214b::A, + ) -> pavex::response::Response { + let v4 = app_e4a8214b::handler(v3, v0, v1, v2); + ::into_response(v4) + } + struct Next0<'a, 'b, T> + where + T: std::future::Future, + { + s_0: &'a app_e4a8214b::B, + s_1: app_e4a8214b::C<'static>, + s_2: alloc::vec::Vec, + s_3: &'b app_e4a8214b::A, + next: fn( + &'a app_e4a8214b::B, + app_e4a8214b::C<'static>, + alloc::vec::Vec, + &'b app_e4a8214b::A, + ) -> T, + } + impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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, self.s_1, self.s_2, self.s_3) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_works/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_works/lib.rs rename to libs/ui_tests/blueprint/prebuilts/prebuilt_works/src/lib.rs diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/src/main.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/src/main.rs new file mode 100644 index 000000000..0e9cf817f --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_e4a8214b::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_works/test_config.toml b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilt_works/test_config.toml rename to libs/ui_tests/blueprint/prebuilts/prebuilt_works/test_config.toml diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/Cargo.toml new file mode 100644 index 000000000..50d8110f9 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_4c9069e8" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/diagnostics.dot b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/diagnostics.dot new file mode 100644 index 000000000..5a0fa8ea4 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/diagnostics.dot @@ -0,0 +1,54 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(app_4c9069e8::A, &'a app_4c9069e8::B) -> crate::route_0::Next0<'a>"] + 3 [ label = "app_4c9069e8::A"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&app_4c9069e8::B"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 5 [ ] + 6 -> 2 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_4c9069e8::handler(app_4c9069e8::A, &app_4c9069e8::B) -> pavex::response::Response"] + 1 [ label = "app_4c9069e8::A"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&app_4c9069e8::B"] + 1 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_4c9069e8::A, app_4c9069e8::B) -> crate::ApplicationState"] + 1 [ label = "app_4c9069e8::A"] + 2 [ label = "app_4c9069e8::b(app_4c9069e8::A) -> app_4c9069e8::B"] + 3 [ label = "::clone(&app_4c9069e8::A) -> app_4c9069e8::A"] + 2 -> 0 [ ] + 1 -> 2 [ ] + 1 -> 3 [ label = "&"] + 3 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/app.rs b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/app.rs rename to libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/diagnostics.dot b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml new file mode 100644 index 000000000..ccafadca1 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_4c9069e8" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_4c9069e8 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/blueprint.ron b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/blueprint.ron new file mode 100644 index 000000000..028193b9f --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/blueprint.ron @@ -0,0 +1,67 @@ +( + creation_location: ( + line: 20, + column: 18, + file: "blueprint/prebuilts/prebuilts_can_be_cloned/src/lib.rs", + ), + components: [ + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_4c9069e8", + module_path: "app_4c9069e8", + ), + import_path: "crate::A", + ), + location: ( + line: 21, + column: 8, + file: "blueprint/prebuilts/prebuilts_can_be_cloned/src/lib.rs", + ), + ), + cloning_strategy: Some(CloneIfNecessary), + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_4c9069e8", + module_path: "app_4c9069e8", + ), + import_path: "crate::b", + ), + location: ( + line: 22, + column: 8, + file: "blueprint/prebuilts/prebuilts_can_be_cloned/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_4c9069e8", + module_path: "app_4c9069e8", + ), + import_path: "crate::handler", + ), + location: ( + line: 23, + column: 8, + file: "blueprint/prebuilts/prebuilts_can_be_cloned/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/src/lib.rs new file mode 100644 index 000000000..c46b75036 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/src/lib.rs @@ -0,0 +1,181 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_4c9069e8::A, + s1: app_4c9069e8::B, +} +pub async fn build_application_state(v0: app_4c9069e8::A) -> crate::ApplicationState { + let v1 = ::clone(&v0); + let v2 = app_4c9069e8::b(v0); + crate::ApplicationState { + s0: v1, + s1: v2, + } +} +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("/", 0u32).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_1::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::GET => { + route_0::entrypoint( + server_state.application_state.s0.clone(), + &server_state.application_state.s1, + ) + .await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>( + s_0: app_4c9069e8::A, + s_1: &'a app_4c9069e8::B, + ) -> pavex::response::Response { + let response = wrapping_0(s_0, s_1).await; + response + } + async fn stage_1<'a>( + s_0: app_4c9069e8::A, + s_1: &'a app_4c9069e8::B, + ) -> pavex::response::Response { + let response = handler(s_0, s_1).await; + response + } + async fn wrapping_0( + v0: app_4c9069e8::A, + v1: &app_4c9069e8::B, + ) -> pavex::response::Response { + let v2 = crate::route_0::Next0 { + s_0: v0, + s_1: v1, + next: stage_1, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = pavex::middleware::wrap_noop(v3).await; + ::into_response(v4) + } + async fn handler( + v0: app_4c9069e8::A, + v1: &app_4c9069e8::B, + ) -> pavex::response::Response { + let v2 = app_4c9069e8::handler(v0, v1); + ::into_response(v2) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: app_4c9069e8::A, + s_1: &'a app_4c9069e8::B, + next: fn(app_4c9069e8::A, &'a app_4c9069e8::B) -> 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, self.s_1) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/lib.rs rename to libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/src/lib.rs diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/src/main.rs b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/src/main.rs new file mode 100644 index 000000000..37cd52696 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_4c9069e8::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/test_config.toml b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/test_config.toml rename to libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/test_config.toml diff --git a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/Cargo.toml new file mode 100644 index 000000000..97ba77342 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_ee506b88" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/diagnostics.dot b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/diagnostics.dot new file mode 100644 index 000000000..212afdb4c --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/diagnostics.dot @@ -0,0 +1,3 @@ +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/app.rs b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/app.rs rename to libs/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/diagnostics.dot b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/stderr.txt b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/stderr.txt rename to libs/ui_tests/blueprint/prebuilts/unused_prebuilt/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml new file mode 100644 index 000000000..1db7a9cd5 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "application_ee506b88" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/blueprint.ron b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/blueprint.ron new file mode 100644 index 000000000..f85a5ef0e --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/blueprint.ron @@ -0,0 +1,26 @@ +( + creation_location: ( + line: 7, + column: 18, + file: "blueprint/prebuilts/unused_prebuilt/src/lib.rs", + ), + components: [ + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_ee506b88", + module_path: "app_ee506b88", + ), + import_path: "crate::Unused", + ), + location: ( + line: 8, + column: 8, + file: "blueprint/prebuilts/unused_prebuilt/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/src/lib.rs new file mode 100644 index 000000000..74f099cc2 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/src/lib.rs @@ -0,0 +1,101 @@ +//! 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 +} +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_0::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 { + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + 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_0::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/unused_prebuilt/lib.rs b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/unused_prebuilt/lib.rs rename to libs/ui_tests/blueprint/prebuilts/unused_prebuilt/src/lib.rs diff --git a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/src/main.rs b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/src/main.rs new file mode 100644 index 000000000..7731080e3 --- /dev/null +++ b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ee506b88::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/unused_prebuilt/test_config.toml b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/prebuilts/unused_prebuilt/test_config.toml rename to libs/ui_tests/blueprint/prebuilts/unused_prebuilt/test_config.toml diff --git a/libs/ui_tests/blueprint/router/ambiguous_fallback/Cargo.toml b/libs/ui_tests/blueprint/router/ambiguous_fallback/Cargo.toml new file mode 100644 index 000000000..29e920bcb --- /dev/null +++ b/libs/ui_tests/blueprint/router/ambiguous_fallback/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_9fbe7a0c" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/ambiguous_fallback/expectations/stderr.txt b/libs/ui_tests/blueprint/router/ambiguous_fallback/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/ambiguous_fallback/expectations/stderr.txt rename to libs/ui_tests/blueprint/router/ambiguous_fallback/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/Cargo.toml new file mode 100644 index 000000000..be4b5b16b --- /dev/null +++ b/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_9fbe7a0c" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/blueprint.ron new file mode 100644 index 000000000..5f3e8c9fa --- /dev/null +++ b/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/blueprint.ron @@ -0,0 +1,85 @@ +( + creation_location: ( + line: 20, + column: 18, + file: "blueprint/router/ambiguous_fallback/src/lib.rs", + ), + components: [ + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 22, + column: 22, + file: "blueprint/router/ambiguous_fallback/src/lib.rs", + ), + components: [ + Route(( + path: "/id", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_9fbe7a0c", + module_path: "app_9fbe7a0c", + ), + import_path: "crate::handler", + ), + location: ( + line: 23, + column: 12, + file: "blueprint/router/ambiguous_fallback/src/lib.rs", + ), + ), + error_handler: None, + )), + FallbackRequestHandler(( + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_9fbe7a0c", + module_path: "app_9fbe7a0c", + ), + import_path: "crate::fallback1", + ), + location: ( + line: 24, + column: 12, + file: "blueprint/router/ambiguous_fallback/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: Some("/users"), + nesting_location: ( + line: 21, + column: 8, + file: "blueprint/router/ambiguous_fallback/src/lib.rs", + ), + )), + Route(( + path: "/users/yo", + method_guard: Some([ + "POST", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_9fbe7a0c", + module_path: "app_9fbe7a0c", + ), + import_path: "crate::handler", + ), + location: ( + line: 27, + column: 8, + file: "blueprint/router/ambiguous_fallback/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/ambiguous_fallback/lib.rs b/libs/ui_tests/blueprint/router/ambiguous_fallback/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/ambiguous_fallback/lib.rs rename to libs/ui_tests/blueprint/router/ambiguous_fallback/src/lib.rs diff --git a/libs/ui_tests/blueprint/router/ambiguous_fallback/src/main.rs b/libs/ui_tests/blueprint/router/ambiguous_fallback/src/main.rs new file mode 100644 index 000000000..4190089c9 --- /dev/null +++ b/libs/ui_tests/blueprint/router/ambiguous_fallback/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_9fbe7a0c::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/ambiguous_fallback/test_config.toml b/libs/ui_tests/blueprint/router/ambiguous_fallback/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/ambiguous_fallback/test_config.toml rename to libs/ui_tests/blueprint/router/ambiguous_fallback/test_config.toml diff --git a/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/Cargo.toml b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/Cargo.toml new file mode 100644 index 000000000..9e08e5d5a --- /dev/null +++ b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_6b4ffaf2" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/expectations/stderr.txt b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/expectations/stderr.txt rename to libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/Cargo.toml new file mode 100644 index 000000000..7ee8db0a8 --- /dev/null +++ b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_6b4ffaf2" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/blueprint.ron new file mode 100644 index 000000000..475f0984c --- /dev/null +++ b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/blueprint.ron @@ -0,0 +1,59 @@ +( + creation_location: ( + line: 16, + column: 18, + file: "blueprint/router/conflicting_any_and_single_method_guards/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "CONNECT", + "DELETE", + "GET", + "HEAD", + "OPTIONS", + "PATCH", + "POST", + "PUT", + "TRACE", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_6b4ffaf2", + module_path: "app_6b4ffaf2", + ), + import_path: "crate::handler_1", + ), + location: ( + line: 17, + column: 8, + file: "blueprint/router/conflicting_any_and_single_method_guards/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_6b4ffaf2", + module_path: "app_6b4ffaf2", + ), + import_path: "crate::handler_2", + ), + location: ( + line: 18, + column: 8, + file: "blueprint/router/conflicting_any_and_single_method_guards/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/lib.rs b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/lib.rs rename to libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/src/lib.rs diff --git a/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/src/main.rs b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/src/main.rs new file mode 100644 index 000000000..99368e053 --- /dev/null +++ b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_6b4ffaf2::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/test_config.toml b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/test_config.toml rename to libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/test_config.toml diff --git a/libs/ui_tests/blueprint/router/different_fallback_for_each_method/Cargo.toml b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/Cargo.toml new file mode 100644 index 000000000..664fd8d79 --- /dev/null +++ b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_951b7f8d" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/different_fallback_for_each_method/expectations/stderr.txt b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/different_fallback_for_each_method/expectations/stderr.txt rename to libs/ui_tests/blueprint/router/different_fallback_for_each_method/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/Cargo.toml new file mode 100644 index 000000000..4d7a26379 --- /dev/null +++ b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_951b7f8d" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/blueprint.ron new file mode 100644 index 000000000..d28964af9 --- /dev/null +++ b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/blueprint.ron @@ -0,0 +1,119 @@ +( + creation_location: ( + line: 20, + column: 18, + file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", + ), + components: [ + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 22, + column: 22, + file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", + ), + components: [ + Route(( + path: "/id", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_951b7f8d", + module_path: "app_951b7f8d", + ), + import_path: "crate::handler", + ), + location: ( + line: 23, + column: 12, + file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", + ), + ), + error_handler: None, + )), + FallbackRequestHandler(( + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_951b7f8d", + module_path: "app_951b7f8d", + ), + import_path: "crate::fallback1", + ), + location: ( + line: 24, + column: 12, + file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 21, + column: 8, + file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", + ), + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 28, + column: 22, + file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", + ), + components: [ + Route(( + path: "/id", + method_guard: Some([ + "POST", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_951b7f8d", + module_path: "app_951b7f8d", + ), + import_path: "crate::handler", + ), + location: ( + line: 29, + column: 12, + file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", + ), + ), + error_handler: None, + )), + FallbackRequestHandler(( + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_951b7f8d", + module_path: "app_951b7f8d", + ), + import_path: "crate::fallback2", + ), + location: ( + line: 30, + column: 12, + file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 27, + column: 8, + file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/different_fallback_for_each_method/lib.rs b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/different_fallback_for_each_method/lib.rs rename to libs/ui_tests/blueprint/router/different_fallback_for_each_method/src/lib.rs diff --git a/libs/ui_tests/blueprint/router/different_fallback_for_each_method/src/main.rs b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/src/main.rs new file mode 100644 index 000000000..423f5b431 --- /dev/null +++ b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_951b7f8d::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/different_fallback_for_each_method/test_config.toml b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/different_fallback_for_each_method/test_config.toml rename to libs/ui_tests/blueprint/router/different_fallback_for_each_method/test_config.toml diff --git a/libs/ui_tests/blueprint/router/fallback_priority/Cargo.toml b/libs/ui_tests/blueprint/router/fallback_priority/Cargo.toml new file mode 100644 index 000000000..39923413d --- /dev/null +++ b/libs/ui_tests/blueprint/router/fallback_priority/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_78452ff2" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/router/fallback_priority/diagnostics.dot b/libs/ui_tests/blueprint/router/fallback_priority/diagnostics.dot new file mode 100644 index 000000000..4a13e984b --- /dev/null +++ b/libs/ui_tests/blueprint/router/fallback_priority/diagnostics.dot @@ -0,0 +1,83 @@ +digraph "* /users*catch_all - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_2::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_2::Next0() -> crate::route_2::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "* /users*catch_all - 1" { + 0 [ label = "app_78452ff2::unauthorized() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "GET /users/ - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_1::Next0() -> crate::route_1::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /users/ - 1" { + 0 [ label = "app_78452ff2::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /users/ - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_2::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_2::Next0() -> crate::route_2::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "* /users/ - 1" { + 0 [ label = "app_78452ff2::unauthorized() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "GET /users/id - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_3::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_3::Next0() -> crate::route_3::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /users/id - 1" { + 0 [ label = "app_78452ff2::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /users/id - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_4::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_4::Next0() -> crate::route_4::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "* /users/id - 1" { + 0 [ label = "app_78452ff2::forbidden() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/expectations/app.rs b/libs/ui_tests/blueprint/router/fallback_priority/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/expectations/app.rs rename to libs/ui_tests/blueprint/router/fallback_priority/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/expectations/diagnostics.dot b/libs/ui_tests/blueprint/router/fallback_priority/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/router/fallback_priority/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/expectations/stderr.txt b/libs/ui_tests/blueprint/router/fallback_priority/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/expectations/stderr.txt rename to libs/ui_tests/blueprint/router/fallback_priority/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml new file mode 100644 index 000000000..696e106ff --- /dev/null +++ b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_78452ff2" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_78452ff2 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/blueprint.ron new file mode 100644 index 000000000..f60be2d68 --- /dev/null +++ b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/blueprint.ron @@ -0,0 +1,119 @@ +( + creation_location: ( + line: 21, + column: 18, + file: "blueprint/router/fallback_priority/src/lib.rs", + ), + components: [ + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 23, + column: 22, + file: "blueprint/router/fallback_priority/src/lib.rs", + ), + components: [ + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_78452ff2", + module_path: "app_78452ff2", + ), + import_path: "crate::handler", + ), + location: ( + line: 24, + column: 12, + file: "blueprint/router/fallback_priority/src/lib.rs", + ), + ), + error_handler: None, + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 26, + column: 26, + file: "blueprint/router/fallback_priority/src/lib.rs", + ), + components: [ + Route(( + path: "/id", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_78452ff2", + module_path: "app_78452ff2", + ), + import_path: "crate::handler", + ), + location: ( + line: 27, + column: 16, + file: "blueprint/router/fallback_priority/src/lib.rs", + ), + ), + error_handler: None, + )), + FallbackRequestHandler(( + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_78452ff2", + module_path: "app_78452ff2", + ), + import_path: "crate::forbidden", + ), + location: ( + line: 28, + column: 16, + file: "blueprint/router/fallback_priority/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 25, + column: 12, + file: "blueprint/router/fallback_priority/src/lib.rs", + ), + )), + FallbackRequestHandler(( + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_78452ff2", + module_path: "app_78452ff2", + ), + import_path: "crate::unauthorized", + ), + location: ( + line: 31, + column: 12, + file: "blueprint/router/fallback_priority/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: Some("/users"), + nesting_location: ( + line: 22, + column: 8, + file: "blueprint/router/fallback_priority/src/lib.rs", + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/src/lib.rs new file mode 100644 index 000000000..e4257f8ae --- /dev/null +++ b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/src/lib.rs @@ -0,0 +1,269 @@ +//! 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("/users*catch_all", 0u32).unwrap(); + router.insert("/users/", 1u32).unwrap(); + router.insert("/users/id", 2u32).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_0::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 => route_2::entrypoint().await, + 1u32 => { + match &request_head.method { + &pavex::http::Method::GET => route_1::entrypoint().await, + _ => route_2::entrypoint().await, + } + } + 2u32 => { + match &request_head.method { + &pavex::http::Method::GET => route_3::entrypoint().await, + _ => route_4::entrypoint().await, + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + 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_0::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) + } + } +} +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_78452ff2::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_78452ff2::unauthorized(); + ::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_78452ff2::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_78452ff2::forbidden(); + ::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)() + } + } +} diff --git a/libs/ui_tests/blueprint/router/fallback_priority/integration/Cargo.toml b/libs/ui_tests/blueprint/router/fallback_priority/integration/Cargo.toml new file mode 100644 index 000000000..248e3176e --- /dev/null +++ b/libs/ui_tests/blueprint/router/fallback_priority/integration/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "integration_78452ff2" +version = "0.1.0" +edition = "2021" + +[dependencies.application] +path = "../generated_app" +package = "application_78452ff2" + +[dependencies.app] +path = ".." +package = "app_78452ff2" + +[dev-dependencies.tokio] +workspace = true +features = ["full"] + +[dev-dependencies.reqwest] +workspace = true + +[dev-dependencies.pavex] +workspace = true + +[dev-dependencies.tracing-subscriber] +version = "0.3" +features = ["env-filter", "fmt"] diff --git a/libs/ui_tests/blueprint/router/fallback_priority/integration/src/lib.rs b/libs/ui_tests/blueprint/router/fallback_priority/integration/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/test.rs b/libs/ui_tests/blueprint/router/fallback_priority/integration/tests/run.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/test.rs rename to libs/ui_tests/blueprint/router/fallback_priority/integration/tests/run.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/lib.rs b/libs/ui_tests/blueprint/router/fallback_priority/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/lib.rs rename to libs/ui_tests/blueprint/router/fallback_priority/src/lib.rs diff --git a/libs/ui_tests/blueprint/router/fallback_priority/src/main.rs b/libs/ui_tests/blueprint/router/fallback_priority/src/main.rs new file mode 100644 index 000000000..835205d0d --- /dev/null +++ b/libs/ui_tests/blueprint/router/fallback_priority/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_78452ff2::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/test_config.toml b/libs/ui_tests/blueprint/router/fallback_priority/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/fallback_priority/test_config.toml rename to libs/ui_tests/blueprint/router/fallback_priority/test_config.toml diff --git a/libs/ui_tests/blueprint/router/http_method_routing_variants/Cargo.toml b/libs/ui_tests/blueprint/router/http_method_routing_variants/Cargo.toml new file mode 100644 index 000000000..8efeaf0bd --- /dev/null +++ b/libs/ui_tests/blueprint/router/http_method_routing_variants/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_a6a2e116" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/router/http_method_routing_variants/diagnostics.dot b/libs/ui_tests/blueprint/router/http_method_routing_variants/diagnostics.dot new file mode 100644 index 000000000..ee0c6f35c --- /dev/null +++ b/libs/ui_tests/blueprint/router/http_method_routing_variants/diagnostics.dot @@ -0,0 +1,487 @@ +digraph "CONNECT | DELETE | GET | HEAD | OPTIONS | PATCH | POST | PUT | TRACE /any - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_9::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_9::Next0() -> crate::route_9::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "CONNECT | DELETE | GET | HEAD | OPTIONS | PATCH | POST | PUT | TRACE /any - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /any - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /any - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* /any_w_extensions - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_10::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_10::Next0() -> crate::route_10::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "* /any_w_extensions - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "CONNECT /connect - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "CONNECT /connect - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /connect - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /connect - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "CUSTOM /custom - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_12::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_12::Next0() -> crate::route_12::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "CUSTOM /custom - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /custom - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /custom - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "DELETE /delete - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_1::Next0() -> crate::route_1::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "DELETE /delete - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /delete - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /delete - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /get - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_2::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_2::Next0() -> crate::route_2::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /get - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /get - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /get - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "HEAD /head - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_3::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_3::Next0() -> crate::route_3::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "HEAD /head - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /head - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /head - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "PATCH | POST /mixed - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_11::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_11::Next0() -> crate::route_11::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "PATCH | POST /mixed - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /mixed - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /mixed - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "CUSTOM | GET | HEY /mixed_with_custom - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_13::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_13::Next0() -> crate::route_13::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "CUSTOM | GET | HEY /mixed_with_custom - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /mixed_with_custom - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /mixed_with_custom - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "OPTIONS /options - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_4::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_4::Next0() -> crate::route_4::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "OPTIONS /options - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /options - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /options - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "PATCH /patch - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_5::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_5::Next0() -> crate::route_5::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "PATCH /patch - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /patch - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /patch - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "POST /post - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_6::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_6::Next0() -> crate::route_6::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "POST /post - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /post - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /post - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "PUT /put - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_7::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_7::Next0() -> crate::route_7::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "PUT /put - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /put - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /put - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "TRACE /trace - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_8::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_8::Next0() -> crate::route_8::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "TRACE /trace - 1" { + 0 [ label = "app_a6a2e116::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /trace - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_14::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_14::Next0(&'a pavex::router::AllowedMethods) -> crate::route_14::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /trace - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/http_method_routing_variants/expectations/app.rs b/libs/ui_tests/blueprint/router/http_method_routing_variants/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/http_method_routing_variants/expectations/app.rs rename to libs/ui_tests/blueprint/router/http_method_routing_variants/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/http_method_routing_variants/expectations/diagnostics.dot b/libs/ui_tests/blueprint/router/http_method_routing_variants/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/http_method_routing_variants/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/router/http_method_routing_variants/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml new file mode 100644 index 000000000..900962ba3 --- /dev/null +++ b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_a6a2e116" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_a6a2e116 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/blueprint.ron new file mode 100644 index 000000000..10f7368b8 --- /dev/null +++ b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/blueprint.ron @@ -0,0 +1,312 @@ +( + creation_location: ( + line: 18, + column: 18, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + components: [ + Route(( + path: "/connect", + method_guard: Some([ + "CONNECT", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 19, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/delete", + method_guard: Some([ + "DELETE", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 20, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/get", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 21, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/head", + method_guard: Some([ + "HEAD", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 22, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/options", + method_guard: Some([ + "OPTIONS", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 23, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/patch", + method_guard: Some([ + "PATCH", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 24, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/post", + method_guard: Some([ + "POST", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 25, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/put", + method_guard: Some([ + "PUT", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 26, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/trace", + method_guard: Some([ + "TRACE", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 27, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/any", + method_guard: Some([ + "CONNECT", + "DELETE", + "GET", + "HEAD", + "OPTIONS", + "PATCH", + "POST", + "PUT", + "TRACE", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 28, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/any_w_extensions", + method_guard: Any, + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 29, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/mixed", + method_guard: Some([ + "PATCH", + "POST", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 30, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/custom", + method_guard: Some([ + "CUSTOM", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 34, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/mixed_with_custom", + method_guard: Some([ + "CUSTOM", + "GET", + "HEY", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a6a2e116", + module_path: "app_a6a2e116", + ), + import_path: "crate::handler", + ), + location: ( + line: 35, + column: 8, + file: "blueprint/router/http_method_routing_variants/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/src/lib.rs new file mode 100644 index 000000000..49ff64761 --- /dev/null +++ b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/src/lib.rs @@ -0,0 +1,831 @@ +//! 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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/http_method_routing_variants/lib.rs b/libs/ui_tests/blueprint/router/http_method_routing_variants/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/http_method_routing_variants/lib.rs rename to libs/ui_tests/blueprint/router/http_method_routing_variants/src/lib.rs diff --git a/libs/ui_tests/blueprint/router/http_method_routing_variants/src/main.rs b/libs/ui_tests/blueprint/router/http_method_routing_variants/src/main.rs new file mode 100644 index 000000000..b66fededa --- /dev/null +++ b/libs/ui_tests/blueprint/router/http_method_routing_variants/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_a6a2e116::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/http_method_routing_variants/test_config.toml b/libs/ui_tests/blueprint/router/http_method_routing_variants/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/http_method_routing_variants/test_config.toml rename to libs/ui_tests/blueprint/router/http_method_routing_variants/test_config.toml diff --git a/libs/ui_tests/blueprint/router/invalid_paths/Cargo.toml b/libs/ui_tests/blueprint/router/invalid_paths/Cargo.toml new file mode 100644 index 000000000..d1af544c0 --- /dev/null +++ b/libs/ui_tests/blueprint/router/invalid_paths/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_fc852cc3" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/invalid_paths/expectations/stderr.txt b/libs/ui_tests/blueprint/router/invalid_paths/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/invalid_paths/expectations/stderr.txt rename to libs/ui_tests/blueprint/router/invalid_paths/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/router/invalid_paths/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/invalid_paths/generated_app/Cargo.toml new file mode 100644 index 000000000..2df526567 --- /dev/null +++ b/libs/ui_tests/blueprint/router/invalid_paths/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_fc852cc3" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/invalid_paths/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/invalid_paths/generated_app/blueprint.ron new file mode 100644 index 000000000..42bf40645 --- /dev/null +++ b/libs/ui_tests/blueprint/router/invalid_paths/generated_app/blueprint.ron @@ -0,0 +1,122 @@ +( + creation_location: ( + line: 12, + column: 18, + file: "blueprint/router/invalid_paths/src/lib.rs", + ), + components: [ + Route(( + path: "/:too:many:params", + method_guard: Some([ + "CONNECT", + "DELETE", + "GET", + "HEAD", + "OPTIONS", + "PATCH", + "POST", + "PUT", + "TRACE", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_fc852cc3", + module_path: "app_fc852cc3", + ), + import_path: "crate::handler", + ), + location: ( + line: 13, + column: 8, + file: "blueprint/router/invalid_paths/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/*invalid_catch_all/hey", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_fc852cc3", + module_path: "app_fc852cc3", + ), + import_path: "crate::handler", + ), + location: ( + line: 14, + column: 8, + file: "blueprint/router/invalid_paths/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home/:id", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_fc852cc3", + module_path: "app_fc852cc3", + ), + import_path: "crate::handler", + ), + location: ( + line: 15, + column: 8, + file: "blueprint/router/invalid_paths/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home/:home_id", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_fc852cc3", + module_path: "app_fc852cc3", + ), + import_path: "crate::handler", + ), + location: ( + line: 17, + column: 8, + file: "blueprint/router/invalid_paths/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/room/:", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_fc852cc3", + module_path: "app_fc852cc3", + ), + import_path: "crate::handler", + ), + location: ( + line: 19, + column: 8, + file: "blueprint/router/invalid_paths/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/invalid_paths/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/invalid_paths/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/invalid_paths/lib.rs b/libs/ui_tests/blueprint/router/invalid_paths/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/invalid_paths/lib.rs rename to libs/ui_tests/blueprint/router/invalid_paths/src/lib.rs diff --git a/libs/ui_tests/blueprint/router/invalid_paths/src/main.rs b/libs/ui_tests/blueprint/router/invalid_paths/src/main.rs new file mode 100644 index 000000000..4c548b5c9 --- /dev/null +++ b/libs/ui_tests/blueprint/router/invalid_paths/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_fc852cc3::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/invalid_paths/test_config.toml b/libs/ui_tests/blueprint/router/invalid_paths/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/invalid_paths/test_config.toml rename to libs/ui_tests/blueprint/router/invalid_paths/test_config.toml diff --git a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/Cargo.toml b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/Cargo.toml new file mode 100644 index 000000000..9427d14e5 --- /dev/null +++ b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_c7a5ef25" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/diagnostics.dot b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/diagnostics.dot new file mode 100644 index 000000000..01075e10a --- /dev/null +++ b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/diagnostics.dot @@ -0,0 +1,41 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_c7a5ef25::handler(&mut app_c7a5ef25::A) -> pavex::response::Response"] + 1 [ label = "app_c7a5ef25::build() -> app_c7a5ef25::A"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ label = "&mut "] + 0 -> 2 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/request_handlers_can_take_mut_references/expectations/app.rs b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/request_handlers_can_take_mut_references/expectations/app.rs rename to libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/request_handlers_can_take_mut_references/expectations/diagnostics.dot b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/request_handlers_can_take_mut_references/expectations/diagnostics.dot rename to libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/expectations/diagnostics.dot diff --git a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml new file mode 100644 index 000000000..e177f3d42 --- /dev/null +++ b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_c7a5ef25" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_c7a5ef25 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/blueprint.ron new file mode 100644 index 000000000..b1d5f2f26 --- /dev/null +++ b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 16, + column: 18, + file: "blueprint/router/request_handlers_can_take_mut_references/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c7a5ef25", + module_path: "app_c7a5ef25", + ), + import_path: "self::build", + ), + location: ( + line: 17, + column: 8, + file: "blueprint/router/request_handlers_can_take_mut_references/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c7a5ef25", + module_path: "app_c7a5ef25", + ), + import_path: "self::handler", + ), + location: ( + line: 18, + column: 8, + file: "blueprint/router/request_handlers_can_take_mut_references/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/src/lib.rs new file mode 100644 index 000000000..fc618e58e --- /dev/null +++ b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/src/lib.rs @@ -0,0 +1,153 @@ +//! 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("/", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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 mut v0 = app_c7a5ef25::build(); + let v1 = app_c7a5ef25::handler(&mut v0); + ::into_response(v1) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/request_handlers_can_take_mut_references/lib.rs b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/request_handlers_can_take_mut_references/lib.rs rename to libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/src/lib.rs diff --git a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/src/main.rs b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/src/main.rs new file mode 100644 index 000000000..544e8f3da --- /dev/null +++ b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_c7a5ef25::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/request_handlers_can_take_mut_references/test_config.toml b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/request_handlers_can_take_mut_references/test_config.toml rename to libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/test_config.toml diff --git a/libs/ui_tests/blueprint/router/route_path_is_validated/Cargo.toml b/libs/ui_tests/blueprint/router/route_path_is_validated/Cargo.toml new file mode 100644 index 000000000..e52d9e365 --- /dev/null +++ b/libs/ui_tests/blueprint/router/route_path_is_validated/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_c2e83ed5" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/route_path_is_validated/expectations/stderr.txt b/libs/ui_tests/blueprint/router/route_path_is_validated/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/route_path_is_validated/expectations/stderr.txt rename to libs/ui_tests/blueprint/router/route_path_is_validated/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/Cargo.toml new file mode 100644 index 000000000..1f8ab429e --- /dev/null +++ b/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_c2e83ed5" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/blueprint.ron new file mode 100644 index 000000000..b5df5dedf --- /dev/null +++ b/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/blueprint.ron @@ -0,0 +1,51 @@ +( + creation_location: ( + line: 9, + column: 18, + file: "blueprint/router/route_path_is_validated/src/lib.rs", + ), + components: [ + Route(( + path: "", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c2e83ed5", + module_path: "app_c2e83ed5", + ), + import_path: "crate::handler", + ), + location: ( + line: 11, + column: 8, + file: "blueprint/router/route_path_is_validated/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "api", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c2e83ed5", + module_path: "app_c2e83ed5", + ), + import_path: "crate::handler", + ), + location: ( + line: 13, + column: 8, + file: "blueprint/router/route_path_is_validated/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/route_path_is_validated/lib.rs b/libs/ui_tests/blueprint/router/route_path_is_validated/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/route_path_is_validated/lib.rs rename to libs/ui_tests/blueprint/router/route_path_is_validated/src/lib.rs diff --git a/libs/ui_tests/blueprint/router/route_path_is_validated/src/main.rs b/libs/ui_tests/blueprint/router/route_path_is_validated/src/main.rs new file mode 100644 index 000000000..303a1f83a --- /dev/null +++ b/libs/ui_tests/blueprint/router/route_path_is_validated/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_c2e83ed5::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/route_path_is_validated/test_config.toml b/libs/ui_tests/blueprint/router/route_path_is_validated/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/route_path_is_validated/test_config.toml rename to libs/ui_tests/blueprint/router/route_path_is_validated/test_config.toml diff --git a/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/Cargo.toml b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/Cargo.toml new file mode 100644 index 000000000..4b5ec844f --- /dev/null +++ b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_812a13f2" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/expectations/stderr.txt b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/expectations/stderr.txt rename to libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/Cargo.toml new file mode 100644 index 000000000..f92ecec16 --- /dev/null +++ b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_812a13f2" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/blueprint.ron new file mode 100644 index 000000000..945dc4d15 --- /dev/null +++ b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/blueprint.ron @@ -0,0 +1,30 @@ +( + creation_location: ( + line: 7, + column: 18, + file: "blueprint/router/structs_cannot_be_registered_as_handlers/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_812a13f2", + module_path: "app_812a13f2", + ), + import_path: "crate::Streamer", + ), + location: ( + line: 8, + column: 8, + file: "blueprint/router/structs_cannot_be_registered_as_handlers/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/lib.rs b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/lib.rs rename to libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/src/lib.rs diff --git a/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/src/main.rs b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/src/main.rs new file mode 100644 index 000000000..c868c2eb2 --- /dev/null +++ b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_812a13f2::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/test_config.toml b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/test_config.toml rename to libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/test_config.toml diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/Cargo.toml new file mode 100644 index 000000000..9cdeaa0a9 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_af31d59e" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/expectations/stderr.txt b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/expectations/stderr.txt rename to libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/Cargo.toml new file mode 100644 index 000000000..367a29485 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_af31d59e" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/blueprint.ron b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/blueprint.ron new file mode 100644 index 000000000..449182593 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/blueprint.ron @@ -0,0 +1,47 @@ +( + creation_location: ( + line: 20, + column: 18, + file: "blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/lib.rs", + ), + components: [ + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_af31d59e", + module_path: "app_af31d59e", + ), + import_path: "crate::mw", + ), + location: ( + line: 21, + column: 8, + file: "blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_af31d59e", + module_path: "app_af31d59e", + ), + import_path: "crate::handler", + ), + location: ( + line: 22, + column: 8, + file: "blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/src/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/lib.rs rename to libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/lib.rs diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/main.rs b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/main.rs new file mode 100644 index 000000000..502ef1341 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_af31d59e::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/test_config.toml b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/test_config.toml rename to libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/test_config.toml diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/Cargo.toml new file mode 100644 index 000000000..f74ed8010 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_0cb36ccc" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/expectations/stderr.txt b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/expectations/stderr.txt rename to libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/Cargo.toml new file mode 100644 index 000000000..2adb7a7fc --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_0cb36ccc" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/blueprint.ron b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/blueprint.ron new file mode 100644 index 000000000..467b8eb90 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/blueprint.ron @@ -0,0 +1,47 @@ +( + creation_location: ( + line: 14, + column: 18, + file: "blueprint/wrapping_middlewares/must_take_next_as_input/src/lib.rs", + ), + components: [ + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_0cb36ccc", + module_path: "app_0cb36ccc", + ), + import_path: "crate::mw", + ), + location: ( + line: 15, + column: 8, + file: "blueprint/wrapping_middlewares/must_take_next_as_input/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_0cb36ccc", + module_path: "app_0cb36ccc", + ), + import_path: "crate::handler", + ), + location: ( + line: 16, + column: 8, + file: "blueprint/wrapping_middlewares/must_take_next_as_input/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/src/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/lib.rs rename to libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/src/lib.rs diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/src/main.rs b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/src/main.rs new file mode 100644 index 000000000..b1396f5d7 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_0cb36ccc::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/test_config.toml b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/test_config.toml rename to libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/test_config.toml diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/Cargo.toml new file mode 100644 index 000000000..e0299125f --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_3e90eeee" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/expectations/stderr.txt b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/expectations/stderr.txt rename to libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/Cargo.toml new file mode 100644 index 000000000..85b675158 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_3e90eeee" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/blueprint.ron b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/blueprint.ron new file mode 100644 index 000000000..414e88b79 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/blueprint.ron @@ -0,0 +1,47 @@ +( + creation_location: ( + line: 31, + column: 18, + file: "blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/lib.rs", + ), + components: [ + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_3e90eeee", + module_path: "app_3e90eeee", + ), + import_path: "crate::mw", + ), + location: ( + line: 32, + column: 8, + file: "blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_3e90eeee", + module_path: "app_3e90eeee", + ), + import_path: "crate::handler", + ), + location: ( + line: 33, + column: 8, + file: "blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/src/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/lib.rs rename to libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/lib.rs diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/main.rs b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/main.rs new file mode 100644 index 000000000..08c9188a7 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_3e90eeee::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/test_config.toml b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/test_config.toml rename to libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/test_config.toml diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/Cargo.toml new file mode 100644 index 000000000..1c0be10f6 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_7479eeb2" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt rename to libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/expectations/stderr.txt diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml new file mode 100644 index 000000000..afff472fd --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_7479eeb2" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron new file mode 100644 index 000000000..c7b4bfaf7 --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron @@ -0,0 +1,81 @@ +( + creation_location: ( + line: 45, + column: 18, + file: "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + components: [ + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_7479eeb2", + module_path: "app_7479eeb2", + ), + import_path: "crate::generic_wrapping_middleware", + ), + location: ( + line: 46, + column: 8, + file: "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_7479eeb2", + module_path: "app_7479eeb2", + ), + import_path: "crate::doubly_generic_wrapping_middleware", + ), + location: ( + line: 47, + column: 8, + file: "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_7479eeb2", + module_path: "app_7479eeb2", + ), + import_path: "crate::triply_generic_wrapping_middleware", + ), + location: ( + line: 48, + column: 8, + file: "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_7479eeb2", + module_path: "app_7479eeb2", + ), + import_path: "crate::handler", + ), + location: ( + line: 49, + column: 8, + file: "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/lib.rs rename to libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/main.rs b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/main.rs new file mode 100644 index 000000000..da29c73fc --- /dev/null +++ b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_7479eeb2::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/test_config.toml b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/test_config.toml rename to libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/test_config.toml diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/Cargo.toml b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/Cargo.toml new file mode 100644 index 000000000..7ddaa59d4 --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_24d12820" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/expectations/stderr.txt b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/Cargo.toml new file mode 100644 index 000000000..24e1d6e2d --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_24d12820" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/blueprint.ron new file mode 100644 index 000000000..02084b4b8 --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 17, + column: 18, + file: "borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_24d12820", + module_path: "app_24d12820", + ), + import_path: "self::build", + ), + location: ( + line: 18, + column: 8, + file: "borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_24d12820", + module_path: "app_24d12820", + ), + import_path: "self::handler", + ), + location: ( + line: 19, + column: 8, + file: "borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/lib.rs b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/lib.rs rename to libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/main.rs b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/main.rs new file mode 100644 index 000000000..38af9fa08 --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_24d12820::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/test_config.toml b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/test_config.toml rename to libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/test_config.toml diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/Cargo.toml b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/Cargo.toml new file mode 100644 index 000000000..32efceb9b --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_a7783cd8" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/expectations/stderr.txt b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/Cargo.toml new file mode 100644 index 000000000..6adffad6d --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_a7783cd8" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/blueprint.ron new file mode 100644 index 000000000..7a3581b6c --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 17, + column: 18, + file: "borrow_checker/cannot_borrow_singletons_as_mut/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_a7783cd8", + module_path: "app_a7783cd8", + ), + import_path: "self::build", + ), + location: ( + line: 18, + column: 8, + file: "borrow_checker/cannot_borrow_singletons_as_mut/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a7783cd8", + module_path: "app_a7783cd8", + ), + import_path: "self::handler", + ), + location: ( + line: 19, + column: 8, + file: "borrow_checker/cannot_borrow_singletons_as_mut/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/lib.rs b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/lib.rs rename to libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/src/main.rs b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/src/main.rs new file mode 100644 index 000000000..41c577b4a --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_a7783cd8::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/test_config.toml b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/test_config.toml rename to libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/test_config.toml diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/Cargo.toml b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/Cargo.toml new file mode 100644 index 000000000..34dc0100c --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_75542b02" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/expectations/stderr.txt b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/Cargo.toml new file mode 100644 index 000000000..234378ecb --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_75542b02" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/blueprint.ron new file mode 100644 index 000000000..e5fdca9c9 --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 17, + column: 18, + file: "borrow_checker/cannot_borrow_transients_as_mut/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_75542b02", + module_path: "app_75542b02", + ), + import_path: "self::build", + ), + location: ( + line: 18, + column: 8, + file: "borrow_checker/cannot_borrow_transients_as_mut/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_75542b02", + module_path: "app_75542b02", + ), + import_path: "self::handler", + ), + location: ( + line: 19, + column: 8, + file: "borrow_checker/cannot_borrow_transients_as_mut/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/lib.rs b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/lib.rs rename to libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/src/main.rs b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/src/main.rs new file mode 100644 index 000000000..6b2ed6157 --- /dev/null +++ b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_75542b02::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/test_config.toml b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/test_config.toml rename to libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/test_config.toml diff --git a/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/Cargo.toml b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/Cargo.toml new file mode 100644 index 000000000..f094f3c6d --- /dev/null +++ b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_23e2eec5" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/expectations/stderr.txt b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/Cargo.toml new file mode 100644 index 000000000..9fd7c6781 --- /dev/null +++ b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_23e2eec5" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/blueprint.ron new file mode 100644 index 000000000..9483698c7 --- /dev/null +++ b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/blueprint.ron @@ -0,0 +1,103 @@ +( + creation_location: ( + line: 63, + column: 18, + file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_23e2eec5", + module_path: "app_23e2eec5", + ), + import_path: "crate::a", + ), + location: ( + line: 64, + column: 8, + file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_23e2eec5", + module_path: "app_23e2eec5", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 65, + column: 10, + file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", + ), + )), + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_23e2eec5", + module_path: "app_23e2eec5", + ), + import_path: "crate::b", + ), + location: ( + line: 66, + column: 8, + file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_23e2eec5", + module_path: "app_23e2eec5", + ), + import_path: "crate::c", + ), + location: ( + line: 67, + column: 8, + file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_23e2eec5", + module_path: "app_23e2eec5", + ), + import_path: "crate::handler", + ), + location: ( + line: 68, + column: 8, + file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/lib.rs b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/lib.rs rename to libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/main.rs b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/main.rs new file mode 100644 index 000000000..c95ff9551 --- /dev/null +++ b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_23e2eec5::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/test_config.toml b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/test_config.toml rename to libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/test_config.toml diff --git a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/Cargo.toml b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/Cargo.toml new file mode 100644 index 000000000..953aad46f --- /dev/null +++ b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_9717f587" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/diagnostics.dot b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/diagnostics.dot new file mode 100644 index 000000000..8bad76c18 --- /dev/null +++ b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/diagnostics.dot @@ -0,0 +1,54 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_9717f587::handler(app_9717f587::A, app_9717f587::B) -> pavex::response::Response"] + 1 [ label = "core::prelude::rust_2015::Result -> app_9717f587::A"] + 2 [ label = "app_9717f587::b() -> app_9717f587::B"] + 3 [ label = "app_9717f587::a() -> core::prelude::rust_2015::Result"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "core::prelude::rust_2015::Result -> app_9717f587::Error"] + 6 [ label = "app_9717f587::error_handler(&app_9717f587::Error, app_9717f587::B) -> pavex::response::Response"] + 7 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 8 [ label = "`match`"] + 2 -> 0 [ ] + 1 -> 0 [ ] + 8 -> 5 [ ] + 8 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 6 [ label = "&"] + 2 -> 6 [ ] + 6 -> 7 [ ] + 3 -> 8 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/expectations/app.rs b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/expectations/app.rs rename to libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml new file mode 100644 index 000000000..72b64b062 --- /dev/null +++ b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_9717f587" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_9717f587 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/blueprint.ron new file mode 100644 index 000000000..93db13fdd --- /dev/null +++ b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/blueprint.ron @@ -0,0 +1,83 @@ +( + creation_location: ( + line: 50, + column: 18, + file: "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_9717f587", + module_path: "app_9717f587", + ), + import_path: "crate::a", + ), + location: ( + line: 51, + column: 8, + file: "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_9717f587", + module_path: "app_9717f587", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 52, + column: 10, + file: "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs", + ), + )), + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_9717f587", + module_path: "app_9717f587", + ), + import_path: "crate::b", + ), + location: ( + line: 53, + column: 8, + file: "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_9717f587", + module_path: "app_9717f587", + ), + import_path: "crate::handler", + ), + location: ( + line: 54, + column: 8, + file: "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/src/lib.rs new file mode 100644 index 000000000..39712ae5b --- /dev/null +++ b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/src/lib.rs @@ -0,0 +1,166 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_9717f587::a(); + let v1 = match v0 { + Ok(ok) => ok, + Err(v1) => { + return { + let v2 = app_9717f587::b(); + let v3 = app_9717f587::error_handler(&v1, v2); + ::into_response( + v3, + ) + }; + } + }; + let v2 = app_9717f587::b(); + let v3 = app_9717f587::handler(v1, v2); + ::into_response(v3) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/lib.rs b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/lib.rs rename to libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/main.rs b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/main.rs new file mode 100644 index 000000000..18b2b14f3 --- /dev/null +++ b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_9717f587::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/test_config.toml b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/test_config.toml rename to libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/test_config.toml diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/Cargo.toml b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/Cargo.toml new file mode 100644 index 000000000..6e4f9d937 --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_74f21254" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/diagnostics.dot b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/diagnostics.dot new file mode 100644 index 000000000..17bcbf80a --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/diagnostics.dot @@ -0,0 +1,49 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_74f21254::handler(app_74f21254::C, app_74f21254::D) -> pavex::response::Response"] + 1 [ label = "app_74f21254::c(app_74f21254::A, &app_74f21254::B) -> app_74f21254::C"] + 2 [ label = "app_74f21254::d(&app_74f21254::A, app_74f21254::B) -> app_74f21254::D"] + 3 [ label = "app_74f21254::a() -> app_74f21254::A"] + 4 [ label = "app_74f21254::b() -> app_74f21254::B"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 2 -> 0 [ ] + 4 -> 2 [ ] + 3 -> 2 [ label = "&"] + 1 -> 0 [ ] + 4 -> 1 [ label = "&"] + 3 -> 1 [ ] + 0 -> 5 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/expectations/app.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/expectations/app.rs rename to libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml new file mode 100644 index 000000000..865d4d0ca --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_74f21254" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_74f21254 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/blueprint.ron new file mode 100644 index 000000000..803c2032c --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/blueprint.ron @@ -0,0 +1,110 @@ +( + creation_location: ( + line: 58, + column: 18, + file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_74f21254", + module_path: "app_74f21254", + ), + import_path: "crate::a", + ), + location: ( + line: 59, + column: 8, + file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_74f21254", + module_path: "app_74f21254", + ), + import_path: "crate::b", + ), + location: ( + line: 61, + column: 8, + file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_74f21254", + module_path: "app_74f21254", + ), + import_path: "crate::c", + ), + location: ( + line: 63, + column: 8, + file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_74f21254", + module_path: "app_74f21254", + ), + import_path: "crate::d", + ), + location: ( + line: 64, + column: 8, + file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_74f21254", + module_path: "app_74f21254", + ), + import_path: "crate::handler", + ), + location: ( + line: 65, + column: 8, + file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/src/lib.rs new file mode 100644 index 000000000..5adfbe3fb --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/src/lib.rs @@ -0,0 +1,156 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_74f21254::b(); + let v1 = app_74f21254::a(); + let v2 = app_74f21254::d(&v1, v0); + let v3 = app_74f21254::c(v1, &v0); + let v4 = app_74f21254::handler(v3, v2); + ::into_response(v4) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/lib.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/lib.rs rename to libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/main.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/main.rs new file mode 100644 index 000000000..57219d400 --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_74f21254::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/test_config.toml b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/test_config.toml rename to libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/test_config.toml diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/Cargo.toml b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/Cargo.toml new file mode 100644 index 000000000..b0c6210e4 --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_e8f51606" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/diagnostics.dot b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/diagnostics.dot new file mode 100644 index 000000000..e02b2264f --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/diagnostics.dot @@ -0,0 +1,51 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_e8f51606::handler(app_e8f51606::C, app_e8f51606::D) -> pavex::response::Response"] + 1 [ label = "app_e8f51606::c(app_e8f51606::A, &app_e8f51606::B) -> app_e8f51606::C"] + 2 [ label = "app_e8f51606::d(&app_e8f51606::A, app_e8f51606::B) -> app_e8f51606::D"] + 3 [ label = "app_e8f51606::a() -> app_e8f51606::A"] + 4 [ label = "app_e8f51606::b() -> app_e8f51606::B"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "::clone(&app_e8f51606::B) -> app_e8f51606::B"] + 2 -> 0 [ ] + 3 -> 2 [ label = "&"] + 1 -> 0 [ ] + 4 -> 1 [ label = "&"] + 3 -> 1 [ ] + 0 -> 5 [ ] + 4 -> 6 [ label = "&"] + 6 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/expectations/app.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/expectations/app.rs rename to libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml new file mode 100644 index 000000000..bc5532a2b --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_e8f51606" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_e8f51606 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/blueprint.ron new file mode 100644 index 000000000..977d3e8b9 --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/blueprint.ron @@ -0,0 +1,110 @@ +( + creation_location: ( + line: 58, + column: 18, + file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_e8f51606", + module_path: "app_e8f51606", + ), + import_path: "crate::a", + ), + location: ( + line: 59, + column: 8, + file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_e8f51606", + module_path: "app_e8f51606", + ), + import_path: "crate::b", + ), + location: ( + line: 61, + column: 8, + file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_e8f51606", + module_path: "app_e8f51606", + ), + import_path: "crate::c", + ), + location: ( + line: 63, + column: 8, + file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_e8f51606", + module_path: "app_e8f51606", + ), + import_path: "crate::d", + ), + location: ( + line: 64, + column: 8, + file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_e8f51606", + module_path: "app_e8f51606", + ), + import_path: "crate::handler", + ), + location: ( + line: 65, + column: 8, + file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/src/lib.rs new file mode 100644 index 000000000..42c8b4843 --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/src/lib.rs @@ -0,0 +1,157 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_e8f51606::a(); + let v1 = app_e8f51606::b(); + let v2 = ::clone(&v1); + let v3 = app_e8f51606::d(&v0, v2); + let v4 = app_e8f51606::c(v0, &v1); + let v5 = app_e8f51606::handler(v4, v3); + ::into_response(v5) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/lib.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/lib.rs rename to libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/main.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/main.rs new file mode 100644 index 000000000..f2d5db504 --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_e8f51606::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/test_config.toml b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/test_config.toml rename to libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/test_config.toml diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/Cargo.toml b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/Cargo.toml new file mode 100644 index 000000000..aeb830712 --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_8ce66b53" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/expectations/stderr.txt b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/Cargo.toml new file mode 100644 index 000000000..9e9ea492f --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_8ce66b53" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/blueprint.ron new file mode 100644 index 000000000..ebf152fa0 --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/blueprint.ron @@ -0,0 +1,110 @@ +( + creation_location: ( + line: 51, + column: 18, + file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_8ce66b53", + module_path: "app_8ce66b53", + ), + import_path: "crate::a", + ), + location: ( + line: 52, + column: 8, + file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_8ce66b53", + module_path: "app_8ce66b53", + ), + import_path: "crate::b", + ), + location: ( + line: 54, + column: 8, + file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_8ce66b53", + module_path: "app_8ce66b53", + ), + import_path: "crate::c", + ), + location: ( + line: 55, + column: 8, + file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_8ce66b53", + module_path: "app_8ce66b53", + ), + import_path: "crate::d", + ), + location: ( + line: 56, + column: 8, + file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_8ce66b53", + module_path: "app_8ce66b53", + ), + import_path: "crate::handler", + ), + location: ( + line: 57, + column: 8, + file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/lib.rs b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/lib.rs rename to libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/main.rs b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/main.rs new file mode 100644 index 000000000..51f5c23a9 --- /dev/null +++ b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_8ce66b53::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/test_config.toml b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/test_config.toml rename to libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/test_config.toml diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/Cargo.toml new file mode 100644 index 000000000..7d2852f55 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_821d919e" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/diagnostics.dot b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/diagnostics.dot new file mode 100644 index 000000000..720cbd153 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/diagnostics.dot @@ -0,0 +1,50 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a, 'b>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(pavex::request::path::RawPathParams<'a, 'b>) -> crate::route_0::Next0<'a, 'b>"] + 3 [ label = "pavex::request::path::RawPathParams<'server, 'request>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_821d919e::handler(app_821d919e::B, app_821d919e::C) -> pavex::response::Response"] + 1 [ label = "app_821d919e::b(pavex::request::path::RawPathParams<'_, '_>) -> app_821d919e::B"] + 2 [ label = "app_821d919e::c(pavex::request::path::RawPathParams<'_, '_>) -> app_821d919e::C"] + 3 [ label = "pavex::request::path::RawPathParams<'server, 'request>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = " as core::clone::Clone>::clone(&pavex::request::path::RawPathParams<'server, 'request>) -> pavex::request::path::RawPathParams<'server, 'request>"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 0 [ ] + 0 -> 4 [ ] + 3 -> 5 [ label = "&"] + 5 -> 1 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/expectations/app.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/expectations/app.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml new file mode 100644 index 000000000..8f6a07f0c --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_821d919e" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_821d919e = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/blueprint.ron new file mode 100644 index 000000000..a6dd6ee00 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 41, + column: 18, + file: "borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_821d919e", + module_path: "app_821d919e", + ), + import_path: "crate::b", + ), + location: ( + line: 42, + column: 8, + file: "borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_821d919e", + module_path: "app_821d919e", + ), + import_path: "crate::c", + ), + location: ( + line: 43, + column: 8, + file: "borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_821d919e", + module_path: "app_821d919e", + ), + import_path: "crate::handler", + ), + location: ( + line: 44, + column: 8, + file: "borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/src/lib.rs new file mode 100644 index 000000000..94d63140d --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/src/lib.rs @@ -0,0 +1,168 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint(url_params).await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a, 'b>( + s_0: pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a, 'b>( + s_0: pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: pavex::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = crate::route_0::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::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = as core::clone::Clone>::clone(&v0); + let v2 = app_821d919e::b(v1); + let v3 = app_821d919e::c(v0); + let v4 = app_821d919e::handler(v2, v3); + ::into_response(v4) + } + struct Next0<'a, 'b, T> + where + T: std::future::Future, + { + s_0: pavex::request::path::RawPathParams<'a, 'b>, + next: fn(pavex::request::path::RawPathParams<'a, 'b>) -> T, + } + impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/lib.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/main.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/main.rs new file mode 100644 index 000000000..c70afa689 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_821d919e::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/test_config.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/test_config.toml rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/test_config.toml diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/Cargo.toml new file mode 100644 index 000000000..3520d878f --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_e1c9a48c" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/diagnostics.dot b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/diagnostics.dot new file mode 100644 index 000000000..d78222725 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/diagnostics.dot @@ -0,0 +1,52 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0(app_e1c9a48c::A) -> crate::route_0::Next0"] + 3 [ label = "app_e1c9a48c::A"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_e1c9a48c::handler(app_e1c9a48c::B, app_e1c9a48c::C) -> pavex::response::Response"] + 1 [ label = "app_e1c9a48c::b(app_e1c9a48c::A) -> app_e1c9a48c::B"] + 2 [ label = "app_e1c9a48c::c(app_e1c9a48c::A) -> app_e1c9a48c::C"] + 3 [ label = "app_e1c9a48c::A"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "::clone(&app_e1c9a48c::A) -> app_e1c9a48c::A"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 0 [ ] + 0 -> 4 [ ] + 3 -> 5 [ label = "&"] + 5 -> 1 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_e1c9a48c::A) -> crate::ApplicationState"] + 1 [ label = "app_e1c9a48c::a() -> app_e1c9a48c::A"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/expectations/app.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/expectations/app.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml new file mode 100644 index 000000000..d2665ef72 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_e1c9a48c" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_e1c9a48c = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/blueprint.ron new file mode 100644 index 000000000..a45890ac7 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 46, + column: 18, + file: "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_e1c9a48c", + module_path: "app_e1c9a48c", + ), + import_path: "crate::a", + ), + location: ( + line: 48, + column: 8, + file: "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_e1c9a48c", + module_path: "app_e1c9a48c", + ), + import_path: "crate::b", + ), + location: ( + line: 50, + column: 8, + file: "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_e1c9a48c", + module_path: "app_e1c9a48c", + ), + import_path: "crate::c", + ), + location: ( + line: 51, + column: 8, + file: "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_e1c9a48c", + module_path: "app_e1c9a48c", + ), + import_path: "crate::handler", + ), + location: ( + line: 52, + column: 8, + file: "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/src/lib.rs new file mode 100644 index 000000000..8101fd98e --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/src/lib.rs @@ -0,0 +1,161 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_e1c9a48c::A, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_e1c9a48c::a(); + crate::ApplicationState { s0: v0 } +} +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("/home", 0u32).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_1::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::GET => { + route_0::entrypoint(server_state.application_state.s0.clone()).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint(s_0: app_e1c9a48c::A) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1(s_0: app_e1c9a48c::A) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: app_e1c9a48c::A) -> pavex::response::Response { + let v1 = crate::route_0::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: app_e1c9a48c::A) -> pavex::response::Response { + let v1 = ::clone(&v0); + let v2 = app_e1c9a48c::b(v1); + let v3 = app_e1c9a48c::c(v0); + let v4 = app_e1c9a48c::handler(v2, v3); + ::into_response(v4) + } + struct Next0 + where + T: std::future::Future, + { + s_0: app_e1c9a48c::A, + next: fn(app_e1c9a48c::A) -> 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)(self.s_0) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/lib.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/main.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/main.rs new file mode 100644 index 000000000..7f0ce4b2f --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_e1c9a48c::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/test_config.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/test_config.toml rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/test_config.toml diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/Cargo.toml new file mode 100644 index 000000000..8b77b9913 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_9b6ffdef" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/diagnostics.dot b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/diagnostics.dot new file mode 100644 index 000000000..e8358a0ba --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/diagnostics.dot @@ -0,0 +1,48 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_9b6ffdef::handler(app_9b6ffdef::B, app_9b6ffdef::C) -> pavex::response::Response"] + 1 [ label = "app_9b6ffdef::b(app_9b6ffdef::A) -> app_9b6ffdef::B"] + 2 [ label = "app_9b6ffdef::c(app_9b6ffdef::A) -> app_9b6ffdef::C"] + 3 [ label = "app_9b6ffdef::a() -> app_9b6ffdef::A"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "::clone(&app_9b6ffdef::A) -> app_9b6ffdef::A"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 0 [ ] + 0 -> 4 [ ] + 3 -> 5 [ label = "&"] + 5 -> 1 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/expectations/app.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/expectations/app.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml new file mode 100644 index 000000000..212e8c0c9 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_9b6ffdef" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_9b6ffdef = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/blueprint.ron new file mode 100644 index 000000000..0cc5fa402 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 46, + column: 18, + file: "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_9b6ffdef", + module_path: "app_9b6ffdef", + ), + import_path: "crate::a", + ), + location: ( + line: 47, + column: 8, + file: "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_9b6ffdef", + module_path: "app_9b6ffdef", + ), + import_path: "crate::b", + ), + location: ( + line: 49, + column: 8, + file: "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_9b6ffdef", + module_path: "app_9b6ffdef", + ), + import_path: "crate::c", + ), + location: ( + line: 50, + column: 8, + file: "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_9b6ffdef", + module_path: "app_9b6ffdef", + ), + import_path: "crate::handler", + ), + location: ( + line: 51, + column: 8, + file: "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/src/lib.rs new file mode 100644 index 000000000..33f3372b6 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/src/lib.rs @@ -0,0 +1,156 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_9b6ffdef::a(); + let v1 = ::clone(&v0); + let v2 = app_9b6ffdef::b(v1); + let v3 = app_9b6ffdef::c(v0); + let v4 = app_9b6ffdef::handler(v2, v3); + ::into_response(v4) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/lib.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/main.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/main.rs new file mode 100644 index 000000000..d917ad28d --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_9b6ffdef::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/test_config.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/test_config.toml rename to libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/test_config.toml diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/Cargo.toml new file mode 100644 index 000000000..126178390 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_ba0e5d33" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/diagnostics.dot b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/diagnostics.dot new file mode 100644 index 000000000..8cb9ad4ed --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/diagnostics.dot @@ -0,0 +1,46 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_ba0e5d33::handler(app_ba0e5d33::B, app_ba0e5d33::C) -> pavex::response::Response"] + 1 [ label = "app_ba0e5d33::b(app_ba0e5d33::A) -> app_ba0e5d33::B"] + 2 [ label = "app_ba0e5d33::c(app_ba0e5d33::A) -> app_ba0e5d33::C"] + 3 [ label = "app_ba0e5d33::a() -> app_ba0e5d33::A"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 0 [ ] + 3 -> 1 [ ] + 0 -> 4 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/expectations/app.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/expectations/app.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml new file mode 100644 index 000000000..1807633b3 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_ba0e5d33" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_ba0e5d33 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/blueprint.ron new file mode 100644 index 000000000..1a3431f92 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 46, + column: 18, + file: "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ba0e5d33", + module_path: "app_ba0e5d33", + ), + import_path: "crate::a", + ), + location: ( + line: 47, + column: 8, + file: "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ba0e5d33", + module_path: "app_ba0e5d33", + ), + import_path: "crate::b", + ), + location: ( + line: 49, + column: 8, + file: "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ba0e5d33", + module_path: "app_ba0e5d33", + ), + import_path: "crate::c", + ), + location: ( + line: 50, + column: 8, + file: "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ba0e5d33", + module_path: "app_ba0e5d33", + ), + import_path: "crate::handler", + ), + location: ( + line: 51, + column: 8, + file: "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/src/lib.rs new file mode 100644 index 000000000..a692b9f03 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/src/lib.rs @@ -0,0 +1,155 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_ba0e5d33::a(); + let v1 = app_ba0e5d33::c(v0); + let v2 = app_ba0e5d33::b(v0); + let v3 = app_ba0e5d33::handler(v2, v1); + ::into_response(v3) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/lib.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/main.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/main.rs new file mode 100644 index 000000000..76d547b78 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ba0e5d33::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/test_config.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/test_config.toml rename to libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/test_config.toml diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/Cargo.toml new file mode 100644 index 000000000..69f1ccf7a --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_53427e7d" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/expectations/stderr.txt b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/Cargo.toml new file mode 100644 index 000000000..5fc4481ff --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_53427e7d" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/blueprint.ron new file mode 100644 index 000000000..6b7ff2f86 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 39, + column: 18, + file: "borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_53427e7d", + module_path: "app_53427e7d", + ), + import_path: "crate::b", + ), + location: ( + line: 40, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_53427e7d", + module_path: "app_53427e7d", + ), + import_path: "crate::c", + ), + location: ( + line: 41, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_53427e7d", + module_path: "app_53427e7d", + ), + import_path: "crate::handler", + ), + location: ( + line: 42, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/lib.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/main.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/main.rs new file mode 100644 index 000000000..5e80262a2 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_53427e7d::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/test_config.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/test_config.toml rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/test_config.toml diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/Cargo.toml new file mode 100644 index 000000000..0fe982727 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_335ca652" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/expectations/stderr.txt b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/Cargo.toml new file mode 100644 index 000000000..a9a16d5a3 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_335ca652" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/blueprint.ron new file mode 100644 index 000000000..4ca70f168 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 42, + column: 18, + file: "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_335ca652", + module_path: "app_335ca652", + ), + import_path: "crate::a", + ), + location: ( + line: 44, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_335ca652", + module_path: "app_335ca652", + ), + import_path: "crate::b", + ), + location: ( + line: 45, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_335ca652", + module_path: "app_335ca652", + ), + import_path: "crate::c", + ), + location: ( + line: 46, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_335ca652", + module_path: "app_335ca652", + ), + import_path: "crate::handler", + ), + location: ( + line: 47, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/lib.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/main.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/main.rs new file mode 100644 index 000000000..fcbc27125 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_335ca652::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/test_config.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/test_config.toml rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/test_config.toml diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/Cargo.toml new file mode 100644 index 000000000..4740ff040 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_8ee91948" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/expectations/stderr.txt b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/Cargo.toml new file mode 100644 index 000000000..f42a5a266 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_8ee91948" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/blueprint.ron new file mode 100644 index 000000000..8b960c25e --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 41, + column: 18, + file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_8ee91948", + module_path: "app_8ee91948", + ), + import_path: "crate::a", + ), + location: ( + line: 42, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_8ee91948", + module_path: "app_8ee91948", + ), + import_path: "crate::b", + ), + location: ( + line: 43, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_8ee91948", + module_path: "app_8ee91948", + ), + import_path: "crate::c", + ), + location: ( + line: 44, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_8ee91948", + module_path: "app_8ee91948", + ), + import_path: "crate::handler", + ), + location: ( + line: 45, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/lib.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/main.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/main.rs new file mode 100644 index 000000000..26593429e --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_8ee91948::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/test_config.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/test_config.toml rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/test_config.toml diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/Cargo.toml new file mode 100644 index 000000000..c1b2501c8 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_900c9672" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/expectations/stderr.txt b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/Cargo.toml new file mode 100644 index 000000000..f34a46758 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_900c9672" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/blueprint.ron new file mode 100644 index 000000000..ee5080e3c --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/blueprint.ron @@ -0,0 +1,67 @@ +( + creation_location: ( + line: 29, + column: 18, + file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_900c9672", + module_path: "app_900c9672", + ), + import_path: "crate::a", + ), + location: ( + line: 30, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_900c9672", + module_path: "app_900c9672", + ), + import_path: "crate::mw", + ), + location: ( + line: 31, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_900c9672", + module_path: "app_900c9672", + ), + import_path: "crate::handler", + ), + location: ( + line: 32, + column: 8, + file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/lib.rs rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/main.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/main.rs new file mode 100644 index 000000000..c0f127cc3 --- /dev/null +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_900c9672::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/test_config.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/test_config.toml rename to libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/test_config.toml diff --git a/libs/ui_tests/borrow_checker/mutability/Cargo.toml b/libs/ui_tests/borrow_checker/mutability/Cargo.toml new file mode 100644 index 000000000..10dd1766f --- /dev/null +++ b/libs/ui_tests/borrow_checker/mutability/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_90734139" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/expectations/app.rs b/libs/ui_tests/borrow_checker/mutability/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/expectations/app.rs rename to libs/ui_tests/borrow_checker/mutability/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/mutability/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/mutability/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/expectations/stderr.txt b/libs/ui_tests/borrow_checker/mutability/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/mutability/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/mutability/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/mutability/generated_app/Cargo.toml new file mode 100644 index 000000000..0c384670d --- /dev/null +++ b/libs/ui_tests/borrow_checker/mutability/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_90734139" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/mutability/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/mutability/generated_app/blueprint.ron new file mode 100644 index 000000000..9f739de00 --- /dev/null +++ b/libs/ui_tests/borrow_checker/mutability/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 43, + column: 18, + file: "borrow_checker/mutability/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_90734139", + module_path: "app_90734139", + ), + import_path: "crate::a", + ), + location: ( + line: 44, + column: 8, + file: "borrow_checker/mutability/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_90734139", + module_path: "app_90734139", + ), + import_path: "crate::b", + ), + location: ( + line: 45, + column: 8, + file: "borrow_checker/mutability/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_90734139", + module_path: "app_90734139", + ), + import_path: "crate::handler", + ), + location: ( + line: 46, + column: 8, + file: "borrow_checker/mutability/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/mutability/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/mutability/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/lib.rs b/libs/ui_tests/borrow_checker/mutability/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/lib.rs rename to libs/ui_tests/borrow_checker/mutability/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/mutability/src/main.rs b/libs/ui_tests/borrow_checker/mutability/src/main.rs new file mode 100644 index 000000000..d228fefae --- /dev/null +++ b/libs/ui_tests/borrow_checker/mutability/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_90734139::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/test_config.toml b/libs/ui_tests/borrow_checker/mutability/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/mutability/test_config.toml rename to libs/ui_tests/borrow_checker/mutability/test_config.toml diff --git a/libs/ui_tests/borrow_checker/transitive_borrows/Cargo.toml b/libs/ui_tests/borrow_checker/transitive_borrows/Cargo.toml new file mode 100644 index 000000000..ce079eb80 --- /dev/null +++ b/libs/ui_tests/borrow_checker/transitive_borrows/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_7321b637" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/expectations/app.rs b/libs/ui_tests/borrow_checker/transitive_borrows/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/expectations/app.rs rename to libs/ui_tests/borrow_checker/transitive_borrows/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/transitive_borrows/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/transitive_borrows/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/expectations/stderr.txt b/libs/ui_tests/borrow_checker/transitive_borrows/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/transitive_borrows/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/Cargo.toml new file mode 100644 index 000000000..9d4090e53 --- /dev/null +++ b/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_7321b637" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/blueprint.ron new file mode 100644 index 000000000..f16b6c4cd --- /dev/null +++ b/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 47, + column: 18, + file: "borrow_checker/transitive_borrows/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_7321b637", + module_path: "app_7321b637", + ), + import_path: "crate::a", + ), + location: ( + line: 48, + column: 8, + file: "borrow_checker/transitive_borrows/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_7321b637", + module_path: "app_7321b637", + ), + import_path: "crate::b", + ), + location: ( + line: 49, + column: 8, + file: "borrow_checker/transitive_borrows/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_7321b637", + module_path: "app_7321b637", + ), + import_path: "crate::c", + ), + location: ( + line: 50, + column: 8, + file: "borrow_checker/transitive_borrows/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_7321b637", + module_path: "app_7321b637", + ), + import_path: "crate::handler", + ), + location: ( + line: 51, + column: 8, + file: "borrow_checker/transitive_borrows/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/lib.rs b/libs/ui_tests/borrow_checker/transitive_borrows/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/lib.rs rename to libs/ui_tests/borrow_checker/transitive_borrows/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/transitive_borrows/src/main.rs b/libs/ui_tests/borrow_checker/transitive_borrows/src/main.rs new file mode 100644 index 000000000..51a1ae93f --- /dev/null +++ b/libs/ui_tests/borrow_checker/transitive_borrows/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_7321b637::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/test_config.toml b/libs/ui_tests/borrow_checker/transitive_borrows/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/transitive_borrows/test_config.toml rename to libs/ui_tests/borrow_checker/transitive_borrows/test_config.toml diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/Cargo.toml new file mode 100644 index 000000000..b33db6449 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_802eb683" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/diagnostics.dot b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/diagnostics.dot new file mode 100644 index 000000000..7cae787f4 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/diagnostics.dot @@ -0,0 +1,48 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a, 'b>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(pavex::request::path::RawPathParams<'a, 'b>) -> crate::route_0::Next0<'a, 'b>"] + 3 [ label = "pavex::request::path::RawPathParams<'server, 'request>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_802eb683::handler(&pavex::request::path::RawPathParams<'_, '_>, app_802eb683::B) -> pavex::response::Response"] + 1 [ label = "pavex::request::path::RawPathParams<'server, 'request>"] + 2 [ label = "app_802eb683::b(pavex::request::path::RawPathParams<'_, '_>) -> app_802eb683::B"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = " as core::clone::Clone>::clone(&pavex::request::path::RawPathParams<'server, 'request>) -> pavex::request::path::RawPathParams<'server, 'request>"] + 2 -> 0 [ ] + 1 -> 0 [ label = "&"] + 0 -> 3 [ ] + 1 -> 4 [ label = "&"] + 4 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/expectations/app.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/expectations/app.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml new file mode 100644 index 000000000..3e9abf7b4 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_802eb683" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_802eb683 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/blueprint.ron new file mode 100644 index 000000000..abc53f2c7 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 36, + column: 18, + file: "borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_802eb683", + module_path: "app_802eb683", + ), + import_path: "crate::b", + ), + location: ( + line: 37, + column: 8, + file: "borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_802eb683", + module_path: "app_802eb683", + ), + import_path: "crate::handler", + ), + location: ( + line: 38, + column: 8, + file: "borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/src/lib.rs new file mode 100644 index 000000000..1e5bc432f --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/src/lib.rs @@ -0,0 +1,167 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint(url_params).await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a, 'b>( + s_0: pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a, 'b>( + s_0: pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: pavex::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = crate::route_0::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::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = as core::clone::Clone>::clone(&v0); + let v2 = app_802eb683::b(v1); + let v3 = app_802eb683::handler(&v0, v2); + ::into_response(v3) + } + struct Next0<'a, 'b, T> + where + T: std::future::Future, + { + s_0: pavex::request::path::RawPathParams<'a, 'b>, + next: fn(pavex::request::path::RawPathParams<'a, 'b>) -> T, + } + impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/lib.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/main.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/main.rs new file mode 100644 index 000000000..9730f8b19 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_802eb683::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/test_config.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/test_config.toml rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/test_config.toml diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/Cargo.toml new file mode 100644 index 000000000..9f7da696c --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_d2e8db7a" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/diagnostics.dot b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/diagnostics.dot new file mode 100644 index 000000000..02aa7ad5d --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/diagnostics.dot @@ -0,0 +1,50 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0(app_d2e8db7a::A) -> crate::route_0::Next0"] + 3 [ label = "app_d2e8db7a::A"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_d2e8db7a::handler(&app_d2e8db7a::A, app_d2e8db7a::B) -> pavex::response::Response"] + 1 [ label = "app_d2e8db7a::A"] + 2 [ label = "app_d2e8db7a::b(app_d2e8db7a::A) -> app_d2e8db7a::B"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "::clone(&app_d2e8db7a::A) -> app_d2e8db7a::A"] + 2 -> 0 [ ] + 1 -> 0 [ label = "&"] + 0 -> 3 [ ] + 1 -> 4 [ label = "&"] + 4 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_d2e8db7a::A) -> crate::ApplicationState"] + 1 [ label = "app_d2e8db7a::a() -> app_d2e8db7a::A"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/expectations/app.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/expectations/app.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml new file mode 100644 index 000000000..b148aa81f --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_d2e8db7a" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_d2e8db7a = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/blueprint.ron new file mode 100644 index 000000000..add823300 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 41, + column: 18, + file: "borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d2e8db7a", + module_path: "app_d2e8db7a", + ), + import_path: "crate::a", + ), + location: ( + line: 43, + column: 8, + file: "borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d2e8db7a", + module_path: "app_d2e8db7a", + ), + import_path: "crate::b", + ), + location: ( + line: 45, + column: 8, + file: "borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_d2e8db7a", + module_path: "app_d2e8db7a", + ), + import_path: "crate::handler", + ), + location: ( + line: 46, + column: 8, + file: "borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/src/lib.rs new file mode 100644 index 000000000..79f5716cc --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/src/lib.rs @@ -0,0 +1,160 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_d2e8db7a::A, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_d2e8db7a::a(); + crate::ApplicationState { s0: v0 } +} +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("/home", 0u32).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_1::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::GET => { + route_0::entrypoint(server_state.application_state.s0.clone()).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint(s_0: app_d2e8db7a::A) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1(s_0: app_d2e8db7a::A) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: app_d2e8db7a::A) -> pavex::response::Response { + let v1 = crate::route_0::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: app_d2e8db7a::A) -> pavex::response::Response { + let v1 = ::clone(&v0); + let v2 = app_d2e8db7a::b(v1); + let v3 = app_d2e8db7a::handler(&v0, v2); + ::into_response(v3) + } + struct Next0 + where + T: std::future::Future, + { + s_0: app_d2e8db7a::A, + next: fn(app_d2e8db7a::A) -> 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)(self.s_0) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/lib.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/main.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/main.rs new file mode 100644 index 000000000..81956805a --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_d2e8db7a::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/test_config.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/test_config.toml rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/test_config.toml diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/Cargo.toml new file mode 100644 index 000000000..74e3e94fb --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_835fd2b1" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/diagnostics.dot b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/diagnostics.dot new file mode 100644 index 000000000..506c54f87 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/diagnostics.dot @@ -0,0 +1,46 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_835fd2b1::handler(&app_835fd2b1::A, app_835fd2b1::B) -> pavex::response::Response"] + 1 [ label = "app_835fd2b1::a() -> app_835fd2b1::A"] + 2 [ label = "app_835fd2b1::b(app_835fd2b1::A) -> app_835fd2b1::B"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "::clone(&app_835fd2b1::A) -> app_835fd2b1::A"] + 2 -> 0 [ ] + 1 -> 0 [ label = "&"] + 0 -> 3 [ ] + 1 -> 4 [ label = "&"] + 4 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/expectations/app.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/expectations/app.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml new file mode 100644 index 000000000..0c8389eaa --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_835fd2b1" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_835fd2b1 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron new file mode 100644 index 000000000..825be692a --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 41, + column: 18, + file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_835fd2b1", + module_path: "app_835fd2b1", + ), + import_path: "crate::a", + ), + location: ( + line: 42, + column: 8, + file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_835fd2b1", + module_path: "app_835fd2b1", + ), + import_path: "crate::b", + ), + location: ( + line: 44, + column: 8, + file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_835fd2b1", + module_path: "app_835fd2b1", + ), + import_path: "crate::handler", + ), + location: ( + line: 45, + column: 8, + file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs new file mode 100644 index 000000000..01feccd1a --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs @@ -0,0 +1,155 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_835fd2b1::a(); + let v1 = ::clone(&v0); + let v2 = app_835fd2b1::b(v1); + let v3 = app_835fd2b1::handler(&v0, v2); + ::into_response(v3) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/lib.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/main.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/main.rs new file mode 100644 index 000000000..b80c62a58 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_835fd2b1::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/test_config.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/test_config.toml rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/test_config.toml diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/Cargo.toml new file mode 100644 index 000000000..a4ef10b0d --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_2546f91e" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/diagnostics.dot b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/diagnostics.dot new file mode 100644 index 000000000..0e974dc52 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/diagnostics.dot @@ -0,0 +1,44 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_2546f91e::handler(&app_2546f91e::A, app_2546f91e::B) -> pavex::response::Response"] + 1 [ label = "app_2546f91e::a() -> app_2546f91e::A"] + 2 [ label = "app_2546f91e::b(app_2546f91e::A) -> app_2546f91e::B"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 2 -> 0 [ ] + 1 -> 2 [ ] + 1 -> 0 [ label = "&"] + 0 -> 3 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/expectations/app.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/expectations/app.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml new file mode 100644 index 000000000..913115aa7 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_2546f91e" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_2546f91e = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/blueprint.ron new file mode 100644 index 000000000..c2c442c27 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 41, + column: 18, + file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_2546f91e", + module_path: "app_2546f91e", + ), + import_path: "crate::a", + ), + location: ( + line: 42, + column: 8, + file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_2546f91e", + module_path: "app_2546f91e", + ), + import_path: "crate::b", + ), + location: ( + line: 44, + column: 8, + file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_2546f91e", + module_path: "app_2546f91e", + ), + import_path: "crate::handler", + ), + location: ( + line: 45, + column: 8, + file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/src/lib.rs new file mode 100644 index 000000000..48333e9c3 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/src/lib.rs @@ -0,0 +1,154 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_2546f91e::a(); + let v1 = app_2546f91e::b(v0); + let v2 = app_2546f91e::handler(&v0, v1); + ::into_response(v2) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/lib.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/main.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/main.rs new file mode 100644 index 000000000..2ea3032d5 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_2546f91e::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/test_config.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/test_config.toml rename to libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/test_config.toml diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/Cargo.toml new file mode 100644 index 000000000..b65b6183f --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_3acfbc8e" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/expectations/stderr.txt b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/Cargo.toml new file mode 100644 index 000000000..4b09040d8 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_3acfbc8e" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/blueprint.ron new file mode 100644 index 000000000..90b8728ce --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 29, + column: 18, + file: "borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_3acfbc8e", + module_path: "app_3acfbc8e", + ), + import_path: "crate::b", + ), + location: ( + line: 30, + column: 8, + file: "borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_3acfbc8e", + module_path: "app_3acfbc8e", + ), + import_path: "crate::handler", + ), + location: ( + line: 31, + column: 8, + file: "borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/lib.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/main.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/main.rs new file mode 100644 index 000000000..6d55ba61a --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_3acfbc8e::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/test_config.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/test_config.toml rename to libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/test_config.toml diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/Cargo.toml new file mode 100644 index 000000000..2202af2d3 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_18d45c43" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/expectations/stderr.txt b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/Cargo.toml new file mode 100644 index 000000000..d134f0a54 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_18d45c43" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/blueprint.ron new file mode 100644 index 000000000..75bb3cff3 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 36, + column: 18, + file: "borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_18d45c43", + module_path: "app_18d45c43", + ), + import_path: "crate::a", + ), + location: ( + line: 38, + column: 8, + file: "borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_18d45c43", + module_path: "app_18d45c43", + ), + import_path: "crate::b", + ), + location: ( + line: 39, + column: 8, + file: "borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_18d45c43", + module_path: "app_18d45c43", + ), + import_path: "crate::handler", + ), + location: ( + line: 40, + column: 8, + file: "borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/lib.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/main.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/main.rs new file mode 100644 index 000000000..bf72ff650 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_18d45c43::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/test_config.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/test_config.toml rename to libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/test_config.toml diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/Cargo.toml new file mode 100644 index 000000000..af0a20836 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_24452d94" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/expectations/stderr.txt b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/expectations/stderr.txt rename to libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/expectations/stderr.txt diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/Cargo.toml new file mode 100644 index 000000000..2bdb6c6d3 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_24452d94" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/blueprint.ron new file mode 100644 index 000000000..4420f8fc7 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 36, + column: 18, + file: "borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_24452d94", + module_path: "app_24452d94", + ), + import_path: "crate::a", + ), + location: ( + line: 37, + column: 8, + file: "borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_24452d94", + module_path: "app_24452d94", + ), + import_path: "crate::b", + ), + location: ( + line: 38, + column: 8, + file: "borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_24452d94", + module_path: "app_24452d94", + ), + import_path: "crate::handler", + ), + location: ( + line: 39, + column: 8, + file: "borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/lib.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/main.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/main.rs new file mode 100644 index 000000000..be0081f48 --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_24452d94::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/test_config.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/test_config.toml rename to libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/test_config.toml diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/Cargo.toml new file mode 100644 index 000000000..033cd944a --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_01492b3d" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/diagnostics.dot b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/diagnostics.dot new file mode 100644 index 000000000..65e84056f --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/diagnostics.dot @@ -0,0 +1,70 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_01492b3d::mw(app_01492b3d::A, pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "app_01492b3d::a() -> app_01492b3d::A"] + 2 [ label = "pavex::middleware::Next::new(crate::route_0::Next1<'a>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_0::Next1(&'a app_01492b3d::A) -> crate::route_0::Next1<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "::clone(&app_01492b3d::A) -> app_01492b3d::A"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 3 [ label = "&"] + 0 -> 4 [ ] + 1 -> 5 [ label = "&"] + 5 -> 0 [ ] +} + +digraph "GET /home - 2" { + 0 [ label = "app_01492b3d::handler(&app_01492b3d::A) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&app_01492b3d::A"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "app_01492b3d::mw(app_01492b3d::A, pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "app_01492b3d::a() -> app_01492b3d::A"] + 2 [ label = "pavex::middleware::Next::new(crate::route_1::Next1<'a>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_1::Next1(&'a pavex::router::AllowedMethods) -> crate::route_1::Next1<'a>"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&pavex::router::AllowedMethods"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 0 [ ] + 0 -> 5 [ ] + 6 -> 3 [ ] +} + +digraph "* /home - 2" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/expectations/app.rs b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/expectations/app.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/expectations/diagnostics.dot b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/expectations/diagnostics.dot rename to libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/expectations/diagnostics.dot diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml new file mode 100644 index 000000000..cd447a82f --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_01492b3d" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_01492b3d = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron new file mode 100644 index 000000000..36745c98b --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron @@ -0,0 +1,67 @@ +( + creation_location: ( + line: 43, + column: 18, + file: "borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_01492b3d", + module_path: "app_01492b3d", + ), + import_path: "crate::a", + ), + location: ( + line: 44, + column: 8, + file: "borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_01492b3d", + module_path: "app_01492b3d", + ), + import_path: "crate::mw", + ), + location: ( + line: 46, + column: 8, + file: "borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_01492b3d", + module_path: "app_01492b3d", + ), + import_path: "crate::handler", + ), + location: ( + line: 47, + column: 8, + file: "borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs new file mode 100644 index 000000000..e62b4100a --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs @@ -0,0 +1,219 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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 = wrapping_1().await; + response + } + async fn stage_2<'a>(s_0: &'a app_01492b3d::A) -> pavex::response::Response { + let response = handler(s_0).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 wrapping_1() -> pavex::response::Response { + let v0 = app_01492b3d::a(); + let v1 = crate::route_0::Next1 { + s_0: &v0, + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = ::clone(&v0); + let v4 = app_01492b3d::mw(v3, v2); + ::into_response(v4) + } + async fn handler(v0: &app_01492b3d::A) -> pavex::response::Response { + let v1 = app_01492b3d::handler(v0); + ::into_response(v1) + } + 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)() + } + } + struct Next1<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_01492b3d::A, + next: fn(&'a app_01492b3d::A) -> T, + } + impl<'a, T> std::future::IntoFuture for Next1<'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) + } + } +} +pub mod route_1 { + 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 = wrapping_1(s_0).await; + response + } + async fn stage_2<'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_1::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 wrapping_1( + v0: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v1 = crate::route_1::Next1 { + s_0: v0, + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_01492b3d::a(); + let v4 = app_01492b3d::mw(v3, v2); + ::into_response(v4) + } + 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) + } + } + struct Next1<'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 Next1<'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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/lib.rs rename to libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/lib.rs diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/main.rs b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/main.rs new file mode 100644 index 000000000..3275b4eba --- /dev/null +++ b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_01492b3d::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/test_config.toml b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/test_config.toml rename to libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/test_config.toml diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/Cargo.toml b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/Cargo.toml new file mode 100644 index 000000000..88b489ae7 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_56967fe8" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/diagnostics.dot b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/diagnostics.dot new file mode 100644 index 000000000..9fbbdc5ab --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/diagnostics.dot @@ -0,0 +1,39 @@ +digraph "GET /route - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /route - 1" { + 0 [ label = "app_56967fe8::root() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /route - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::connection::ConnectionInfo) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::connection::ConnectionInfo"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /route - 1" { + 0 [ label = "app_56967fe8::get_connection_info(&pavex::connection::ConnectionInfo) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::connection::ConnectionInfo"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/app.rs b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/app.rs rename to libs/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot rename to libs/ui_tests/connection_info/connection_info_fallback_happy_path/expectations/diagnostics.dot diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml new file mode 100644 index 000000000..522ba6736 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_56967fe8" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_56967fe8 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/blueprint.ron b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/blueprint.ron new file mode 100644 index 000000000..a1af6e449 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/blueprint.ron @@ -0,0 +1,47 @@ +( + creation_location: ( + line: 15, + column: 18, + file: "connection_info/connection_info_fallback_happy_path/src/lib.rs", + ), + components: [ + Route(( + path: "/route", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_56967fe8", + module_path: "app_56967fe8", + ), + import_path: "crate::root", + ), + location: ( + line: 16, + column: 8, + file: "connection_info/connection_info_fallback_happy_path/src/lib.rs", + ), + ), + error_handler: None, + )), + FallbackRequestHandler(( + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_56967fe8", + module_path: "app_56967fe8", + ), + import_path: "crate::get_connection_info", + ), + location: ( + line: 17, + column: 8, + file: "connection_info/connection_info_fallback_happy_path/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/src/lib.rs b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/src/lib.rs new file mode 100644 index 000000000..aa774d7d2 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/src/lib.rs @@ -0,0 +1,150 @@ +//! 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("/route", 0u32).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 connection_info = connection_info + .expect("Required ConnectionInfo is missing"); + return route_1::entrypoint(&connection_info).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::GET => route_0::entrypoint().await, + _ => { + let connection_info = connection_info + .expect("Required ConnectionInfo is missing"); + route_1::entrypoint(&connection_info).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_56967fe8::root(); + ::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<'a>( + s_0: &'a pavex::connection::ConnectionInfo, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>( + s_0: &'a pavex::connection::ConnectionInfo, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: &pavex::connection::ConnectionInfo, + ) -> pavex::response::Response { + let v1 = crate::route_1::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::connection::ConnectionInfo, + ) -> pavex::response::Response { + let v1 = app_56967fe8::get_connection_info(v0); + ::into_response(v1) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a pavex::connection::ConnectionInfo, + next: fn(&'a pavex::connection::ConnectionInfo) -> 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) + } + } +} diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/integration/Cargo.toml b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/integration/Cargo.toml new file mode 100644 index 000000000..4fc69c855 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/integration/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "integration_56967fe8" +version = "0.1.0" +edition = "2021" + +[dependencies.application] +path = "../generated_app" +package = "application_56967fe8" + +[dependencies.app] +path = ".." +package = "app_56967fe8" + +[dev-dependencies] +http-body-util = "0.1.1" +hyper = "1.2.0" +hyper-util = "0.1.3" + +[dev-dependencies.tokio] +workspace = true +features = ["full"] + +[dev-dependencies.reqwest] +workspace = true + +[dev-dependencies.pavex] +workspace = true + +[dev-dependencies.tracing-subscriber] +version = "0.3" +features = ["env-filter", "fmt"] diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/integration/src/lib.rs b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/integration/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/test.rs b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/integration/tests/run.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/test.rs rename to libs/ui_tests/connection_info/connection_info_fallback_happy_path/integration/tests/run.rs diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/lib.rs b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/lib.rs rename to libs/ui_tests/connection_info/connection_info_fallback_happy_path/src/lib.rs diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/src/main.rs b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/src/main.rs new file mode 100644 index 000000000..410b03934 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_56967fe8::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/test_config.toml b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/connection_info/connection_info_fallback_happy_path/test_config.toml rename to libs/ui_tests/connection_info/connection_info_fallback_happy_path/test_config.toml diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/Cargo.toml b/libs/ui_tests/connection_info/connection_info_happy_path/Cargo.toml new file mode 100644 index 000000000..5a3bc8b35 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_happy_path/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_a1f930e1" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/diagnostics.dot b/libs/ui_tests/connection_info/connection_info_happy_path/diagnostics.dot new file mode 100644 index 000000000..c9324e30e --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_happy_path/diagnostics.dot @@ -0,0 +1,43 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a pavex::connection::ConnectionInfo) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::connection::ConnectionInfo"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_a1f930e1::get_connection_info(&pavex::connection::ConnectionInfo) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::connection::ConnectionInfo"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path/expectations/app.rs b/libs/ui_tests/connection_info/connection_info_happy_path/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path/expectations/app.rs rename to libs/ui_tests/connection_info/connection_info_happy_path/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path/expectations/diagnostics.dot b/libs/ui_tests/connection_info/connection_info_happy_path/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path/expectations/diagnostics.dot rename to libs/ui_tests/connection_info/connection_info_happy_path/expectations/diagnostics.dot diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml new file mode 100644 index 000000000..e553f1aa7 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_a1f930e1" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_a1f930e1 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/blueprint.ron b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/blueprint.ron new file mode 100644 index 000000000..826714472 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/blueprint.ron @@ -0,0 +1,30 @@ +( + creation_location: ( + line: 11, + column: 18, + file: "connection_info/connection_info_happy_path/src/lib.rs", + ), + components: [ + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a1f930e1", + module_path: "app_a1f930e1", + ), + import_path: "crate::get_connection_info", + ), + location: ( + line: 12, + column: 8, + file: "connection_info/connection_info_happy_path/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/src/lib.rs b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/src/lib.rs new file mode 100644 index 000000000..b29378fc5 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/src/lib.rs @@ -0,0 +1,166 @@ +//! 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("/", 0u32).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_1::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::GET => { + let connection_info = connection_info + .expect("Required ConnectionInfo is missing"); + route_0::entrypoint(&connection_info).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>( + s_0: &'a pavex::connection::ConnectionInfo, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>( + s_0: &'a pavex::connection::ConnectionInfo, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: &pavex::connection::ConnectionInfo, + ) -> pavex::response::Response { + let v1 = crate::route_0::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::connection::ConnectionInfo, + ) -> pavex::response::Response { + let v1 = app_a1f930e1::get_connection_info(v0); + ::into_response(v1) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a pavex::connection::ConnectionInfo, + next: fn(&'a pavex::connection::ConnectionInfo) -> 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) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/integration/Cargo.toml b/libs/ui_tests/connection_info/connection_info_happy_path/integration/Cargo.toml new file mode 100644 index 000000000..d41d7f4f0 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_happy_path/integration/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "integration_a1f930e1" +version = "0.1.0" +edition = "2021" + +[dependencies.application] +path = "../generated_app" +package = "application_a1f930e1" + +[dependencies.app] +path = ".." +package = "app_a1f930e1" + +[dev-dependencies.tokio] +workspace = true +features = ["full"] + +[dev-dependencies.reqwest] +workspace = true + +[dev-dependencies.pavex] +workspace = true + +[dev-dependencies.tracing-subscriber] +version = "0.3" +features = ["env-filter", "fmt"] diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/integration/src/lib.rs b/libs/ui_tests/connection_info/connection_info_happy_path/integration/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path/test.rs b/libs/ui_tests/connection_info/connection_info_happy_path/integration/tests/run.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path/test.rs rename to libs/ui_tests/connection_info/connection_info_happy_path/integration/tests/run.rs diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path/lib.rs b/libs/ui_tests/connection_info/connection_info_happy_path/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path/lib.rs rename to libs/ui_tests/connection_info/connection_info_happy_path/src/lib.rs diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/src/main.rs b/libs/ui_tests/connection_info/connection_info_happy_path/src/main.rs new file mode 100644 index 000000000..9c2337260 --- /dev/null +++ b/libs/ui_tests/connection_info/connection_info_happy_path/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_a1f930e1::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path/test_config.toml b/libs/ui_tests/connection_info/connection_info_happy_path/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/connection_info/connection_info_happy_path/test_config.toml rename to libs/ui_tests/connection_info/connection_info_happy_path/test_config.toml diff --git a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/Cargo.toml b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/Cargo.toml new file mode 100644 index 000000000..fb91c7b52 --- /dev/null +++ b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_366b29bf" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/diagnostics.dot b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/diagnostics.dot new file mode 100644 index 000000000..02bc05a84 --- /dev/null +++ b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/diagnostics.dot @@ -0,0 +1,76 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0(app_366b29bf::Singleton) -> crate::route_0::Next0"] + 3 [ label = "app_366b29bf::Singleton"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_366b29bf::mw(app_366b29bf::Singleton, pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "app_366b29bf::Singleton"] + 2 [ label = "pavex::middleware::Next::new(crate::route_0::Next1) -> pavex::middleware::Next"] + 3 [ label = "crate::route_0::Next1(app_366b29bf::Singleton) -> crate::route_0::Next1"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "::clone(&app_366b29bf::Singleton) -> app_366b29bf::Singleton"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 3 [ ] + 0 -> 4 [ ] + 1 -> 5 [ label = "&"] + 5 -> 0 [ ] +} + +digraph "GET / - 2" { + 0 [ label = "app_366b29bf::handler(app_366b29bf::Singleton) -> pavex::response::Response"] + 1 [ label = "app_366b29bf::Singleton"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods, app_366b29bf::Singleton) -> crate::route_1::Next0<'a>"] + 4 [ label = "app_366b29bf::Singleton"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 4 -> 2 [ ] + 0 -> 5 [ ] + 6 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "app_366b29bf::mw(app_366b29bf::Singleton, pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "app_366b29bf::Singleton"] + 2 [ label = "pavex::middleware::Next::new(crate::route_1::Next1<'a>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_1::Next1(&'a pavex::router::AllowedMethods) -> crate::route_1::Next1<'a>"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&pavex::router::AllowedMethods"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 0 [ ] + 0 -> 5 [ ] + 6 -> 3 [ ] +} + +digraph "* / - 2" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_366b29bf::Singleton) -> crate::ApplicationState"] + 1 [ label = "app_366b29bf::Singleton::new() -> app_366b29bf::Singleton"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/expectations/app.rs b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/expectations/app.rs rename to libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/expectations/diagnostics.dot b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/expectations/diagnostics.dot rename to libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/expectations/diagnostics.dot diff --git a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml new file mode 100644 index 000000000..c67d8bba9 --- /dev/null +++ b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_366b29bf" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_366b29bf = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/blueprint.ron new file mode 100644 index 000000000..3cefe0f59 --- /dev/null +++ b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/blueprint.ron @@ -0,0 +1,67 @@ +( + creation_location: ( + line: 33, + column: 18, + file: "dependency_injection/clone_nodes_are_only_added_where_needed/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_366b29bf", + module_path: "app_366b29bf", + ), + import_path: "crate::Singleton::new", + ), + location: ( + line: 34, + column: 8, + file: "dependency_injection/clone_nodes_are_only_added_where_needed/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_366b29bf", + module_path: "app_366b29bf", + ), + import_path: "crate::mw", + ), + location: ( + line: 36, + column: 8, + file: "dependency_injection/clone_nodes_are_only_added_where_needed/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_366b29bf", + module_path: "app_366b29bf", + ), + import_path: "crate::handler", + ), + location: ( + line: 37, + column: 8, + file: "dependency_injection/clone_nodes_are_only_added_where_needed/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/src/lib.rs new file mode 100644 index 000000000..3ca5bc120 --- /dev/null +++ b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/src/lib.rs @@ -0,0 +1,237 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_366b29bf::Singleton, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_366b29bf::Singleton::new(); + crate::ApplicationState { s0: v0 } +} +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("/", 0u32).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_1::entrypoint( + server_state.application_state.s0.clone(), + &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::GET => { + route_0::entrypoint(server_state.application_state.s0.clone()).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint( + server_state.application_state.s0.clone(), + &allowed_methods, + ) + .await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint(s_0: app_366b29bf::Singleton) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1(s_0: app_366b29bf::Singleton) -> pavex::response::Response { + let response = wrapping_1(s_0).await; + response + } + async fn stage_2(s_0: app_366b29bf::Singleton) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: app_366b29bf::Singleton) -> pavex::response::Response { + let v1 = crate::route_0::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 wrapping_1(v0: app_366b29bf::Singleton) -> pavex::response::Response { + let v1 = ::clone(&v0); + let v2 = crate::route_0::Next1 { + s_0: v0, + next: stage_2, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = app_366b29bf::mw(v1, v3); + ::into_response(v4) + } + async fn handler(v0: app_366b29bf::Singleton) -> pavex::response::Response { + let v1 = app_366b29bf::handler(v0); + ::into_response(v1) + } + struct Next0 + where + T: std::future::Future, + { + s_0: app_366b29bf::Singleton, + next: fn(app_366b29bf::Singleton) -> 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)(self.s_0) + } + } + struct Next1 + where + T: std::future::Future, + { + s_0: app_366b29bf::Singleton, + next: fn(app_366b29bf::Singleton) -> T, + } + impl std::future::IntoFuture for Next1 + where + T: std::future::Future, + { + type Output = pavex::response::Response; + type IntoFuture = T; + fn into_future(self) -> Self::IntoFuture { + (self.next)(self.s_0) + } + } +} +pub mod route_1 { + pub async fn entrypoint<'a>( + s_0: app_366b29bf::Singleton, + s_1: &'a pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let response = wrapping_0(s_0, s_1).await; + response + } + async fn stage_1<'a>( + s_0: &'a pavex::router::AllowedMethods, + s_1: app_366b29bf::Singleton, + ) -> pavex::response::Response { + let response = wrapping_1(s_1, s_0).await; + response + } + async fn stage_2<'a>( + s_0: &'a pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: app_366b29bf::Singleton, + v1: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v2 = crate::route_1::Next0 { + s_0: v1, + s_1: v0, + next: stage_1, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = pavex::middleware::wrap_noop(v3).await; + ::into_response(v4) + } + async fn wrapping_1( + v0: app_366b29bf::Singleton, + v1: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v2 = crate::route_1::Next1 { + s_0: v1, + next: stage_2, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = app_366b29bf::mw(v0, v3); + ::into_response(v4) + } + 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, + s_1: app_366b29bf::Singleton, + next: fn(&'a pavex::router::AllowedMethods, app_366b29bf::Singleton) -> 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, self.s_1) + } + } + struct Next1<'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 Next1<'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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/lib.rs b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/lib.rs rename to libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/src/main.rs b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/src/main.rs new file mode 100644 index 000000000..3bc906a32 --- /dev/null +++ b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_366b29bf::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/test_config.toml b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/test_config.toml rename to libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/test_config.toml diff --git a/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/Cargo.toml b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/Cargo.toml new file mode 100644 index 000000000..556279434 --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_4bcfa44d" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/expectations/stderr.txt b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/expectations/stderr.txt rename to libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/expectations/stderr.txt diff --git a/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/Cargo.toml new file mode 100644 index 000000000..d9c46b9f1 --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_4bcfa44d" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/blueprint.ron new file mode 100644 index 000000000..ff067eb54 --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/blueprint.ron @@ -0,0 +1,83 @@ +( + creation_location: ( + line: 46, + column: 18, + file: "dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_4bcfa44d", + module_path: "app_4bcfa44d", + ), + import_path: "crate::a", + ), + location: ( + line: 47, + column: 8, + file: "dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_4bcfa44d", + module_path: "app_4bcfa44d", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 48, + column: 10, + file: "dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs", + ), + )), + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_4bcfa44d", + module_path: "app_4bcfa44d", + ), + import_path: "crate::b", + ), + location: ( + line: 49, + column: 8, + file: "dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_4bcfa44d", + module_path: "app_4bcfa44d", + ), + import_path: "crate::handler", + ), + location: ( + line: 50, + column: 8, + file: "dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/lib.rs b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/lib.rs rename to libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/src/main.rs b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/src/main.rs new file mode 100644 index 000000000..f3ce8e3ed --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_4bcfa44d::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/test_config.toml b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/test_config.toml rename to libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/test_config.toml diff --git a/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/Cargo.toml b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/Cargo.toml new file mode 100644 index 000000000..3957efedc --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_2480aa2b" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/request_scoped_cycles/expectations/stderr.txt b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/request_scoped_cycles/expectations/stderr.txt rename to libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/expectations/stderr.txt diff --git a/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/Cargo.toml new file mode 100644 index 000000000..ae2656a10 --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_2480aa2b" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/blueprint.ron new file mode 100644 index 000000000..a20ff4c40 --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 47, + column: 18, + file: "dependency_injection/cycles/request_scoped_cycles/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_2480aa2b", + module_path: "app_2480aa2b", + ), + import_path: "crate::a", + ), + location: ( + line: 48, + column: 8, + file: "dependency_injection/cycles/request_scoped_cycles/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_2480aa2b", + module_path: "app_2480aa2b", + ), + import_path: "crate::b", + ), + location: ( + line: 49, + column: 8, + file: "dependency_injection/cycles/request_scoped_cycles/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_2480aa2b", + module_path: "app_2480aa2b", + ), + import_path: "crate::c", + ), + location: ( + line: 50, + column: 8, + file: "dependency_injection/cycles/request_scoped_cycles/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_2480aa2b", + module_path: "app_2480aa2b", + ), + import_path: "crate::handler", + ), + location: ( + line: 51, + column: 8, + file: "dependency_injection/cycles/request_scoped_cycles/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/request_scoped_cycles/lib.rs b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/request_scoped_cycles/lib.rs rename to libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/src/main.rs b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/src/main.rs new file mode 100644 index 000000000..a555b8cd7 --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_2480aa2b::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/request_scoped_cycles/test_config.toml b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/request_scoped_cycles/test_config.toml rename to libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/test_config.toml diff --git a/libs/ui_tests/dependency_injection/cycles/transient_cycles/Cargo.toml b/libs/ui_tests/dependency_injection/cycles/transient_cycles/Cargo.toml new file mode 100644 index 000000000..856b62c7a --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/transient_cycles/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_ca08c5dd" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/transient_cycles/expectations/stderr.txt b/libs/ui_tests/dependency_injection/cycles/transient_cycles/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/transient_cycles/expectations/stderr.txt rename to libs/ui_tests/dependency_injection/cycles/transient_cycles/expectations/stderr.txt diff --git a/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/Cargo.toml new file mode 100644 index 000000000..c6b396414 --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_ca08c5dd" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/blueprint.ron new file mode 100644 index 000000000..b95ccca56 --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 47, + column: 18, + file: "dependency_injection/cycles/transient_cycles/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ca08c5dd", + module_path: "app_ca08c5dd", + ), + import_path: "crate::a", + ), + location: ( + line: 48, + column: 8, + file: "dependency_injection/cycles/transient_cycles/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ca08c5dd", + module_path: "app_ca08c5dd", + ), + import_path: "crate::b", + ), + location: ( + line: 49, + column: 8, + file: "dependency_injection/cycles/transient_cycles/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ca08c5dd", + module_path: "app_ca08c5dd", + ), + import_path: "crate::c", + ), + location: ( + line: 50, + column: 8, + file: "dependency_injection/cycles/transient_cycles/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ca08c5dd", + module_path: "app_ca08c5dd", + ), + import_path: "crate::handler", + ), + location: ( + line: 51, + column: 8, + file: "dependency_injection/cycles/transient_cycles/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/transient_cycles/lib.rs b/libs/ui_tests/dependency_injection/cycles/transient_cycles/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/transient_cycles/lib.rs rename to libs/ui_tests/dependency_injection/cycles/transient_cycles/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/cycles/transient_cycles/src/main.rs b/libs/ui_tests/dependency_injection/cycles/transient_cycles/src/main.rs new file mode 100644 index 000000000..72c079f7b --- /dev/null +++ b/libs/ui_tests/dependency_injection/cycles/transient_cycles/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ca08c5dd::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/transient_cycles/test_config.toml b/libs/ui_tests/dependency_injection/cycles/transient_cycles/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/cycles/transient_cycles/test_config.toml rename to libs/ui_tests/dependency_injection/cycles/transient_cycles/test_config.toml diff --git a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/Cargo.toml b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/Cargo.toml new file mode 100644 index 000000000..9e0bc4510 --- /dev/null +++ b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_40ab089d" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/diagnostics.dot b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/diagnostics.dot new file mode 100644 index 000000000..b51cdfd85 --- /dev/null +++ b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/diagnostics.dot @@ -0,0 +1,102 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_40ab089d::mw(app_40ab089d::Scoped, pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "app_40ab089d::Scoped::new() -> app_40ab089d::Scoped"] + 2 [ label = "pavex::middleware::Next::new(crate::route_0::Next1) -> pavex::middleware::Next"] + 3 [ label = "crate::route_0::Next1(app_40ab089d::Scoped) -> crate::route_0::Next1"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "::clone(&app_40ab089d::Scoped) -> app_40ab089d::Scoped"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 3 [ ] + 0 -> 4 [ ] + 1 -> 5 [ label = "&"] + 5 -> 0 [ ] +} + +digraph "GET / - 2" { + 0 [ label = "app_40ab089d::mw2(&app_40ab089d::Scoped, pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "app_40ab089d::Scoped"] + 2 [ label = "pavex::middleware::Next::new(crate::route_0::Next2) -> pavex::middleware::Next"] + 3 [ label = "crate::route_0::Next2(app_40ab089d::Scoped) -> crate::route_0::Next2"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "::clone(&app_40ab089d::Scoped) -> app_40ab089d::Scoped"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 0 [ label = "&"] + 0 -> 4 [ ] + 1 -> 5 [ label = "&"] + 5 -> 3 [ ] +} + +digraph "GET / - 3" { + 0 [ label = "app_40ab089d::handler(app_40ab089d::Scoped) -> pavex::response::Response"] + 1 [ label = "app_40ab089d::Scoped"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "app_40ab089d::mw(app_40ab089d::Scoped, pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "app_40ab089d::Scoped::new() -> app_40ab089d::Scoped"] + 2 [ label = "pavex::middleware::Next::new(crate::route_1::Next1<'a, 'b>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_1::Next1(&'a pavex::router::AllowedMethods, &'b app_40ab089d::Scoped) -> crate::route_1::Next1<'a, 'b>"] + 4 [ label = "::clone(&app_40ab089d::Scoped) -> app_40ab089d::Scoped"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&pavex::router::AllowedMethods"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 3 [ label = "&"] + 1 -> 4 [ label = "&"] + 0 -> 5 [ ] + 6 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "* / - 2" { + 0 [ label = "app_40ab089d::mw2(&app_40ab089d::Scoped, pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "&pavex::router::AllowedMethods"] + 2 [ label = "pavex::middleware::Next::new(crate::route_1::Next2<'a>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_1::Next2(&'a pavex::router::AllowedMethods) -> crate::route_1::Next2<'a>"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&app_40ab089d::Scoped"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 1 -> 3 [ ] + 0 -> 5 [ ] + 6 -> 0 [ ] +} + +digraph "* / - 3" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/expectations/app.rs b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/expectations/app.rs rename to libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/expectations/diagnostics.dot b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/expectations/diagnostics.dot rename to libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/expectations/diagnostics.dot diff --git a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml new file mode 100644 index 000000000..6ad7147d0 --- /dev/null +++ b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_40ab089d" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_40ab089d = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/blueprint.ron new file mode 100644 index 000000000..8b8699326 --- /dev/null +++ b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/blueprint.ron @@ -0,0 +1,84 @@ +( + creation_location: ( + line: 40, + column: 18, + file: "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_40ab089d", + module_path: "app_40ab089d", + ), + import_path: "crate::Scoped::new", + ), + location: ( + line: 41, + column: 8, + file: "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_40ab089d", + module_path: "app_40ab089d", + ), + import_path: "crate::mw", + ), + location: ( + line: 43, + column: 8, + file: "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs", + ), + ), + error_handler: None, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_40ab089d", + module_path: "app_40ab089d", + ), + import_path: "crate::mw2", + ), + location: ( + line: 44, + column: 8, + file: "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_40ab089d", + module_path: "app_40ab089d", + ), + import_path: "crate::handler", + ), + location: ( + line: 45, + column: 8, + file: "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/src/lib.rs new file mode 100644 index 000000000..8396098f6 --- /dev/null +++ b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/src/lib.rs @@ -0,0 +1,289 @@ +//! 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("/", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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 = wrapping_1().await; + response + } + async fn stage_2(s_0: app_40ab089d::Scoped) -> pavex::response::Response { + let response = wrapping_2(s_0).await; + response + } + async fn stage_3(s_0: app_40ab089d::Scoped) -> pavex::response::Response { + let response = handler(s_0).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 wrapping_1() -> pavex::response::Response { + let v0 = app_40ab089d::Scoped::new(); + let v1 = ::clone(&v0); + let v2 = crate::route_0::Next1 { + s_0: v0, + next: stage_2, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = app_40ab089d::mw(v1, v3); + ::into_response(v4) + } + async fn wrapping_2(v0: app_40ab089d::Scoped) -> pavex::response::Response { + let v1 = ::clone(&v0); + let v2 = crate::route_0::Next2 { + s_0: v1, + next: stage_3, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = app_40ab089d::mw2(&v0, v3); + ::into_response(v4) + } + async fn handler(v0: app_40ab089d::Scoped) -> pavex::response::Response { + let v1 = app_40ab089d::handler(v0); + ::into_response(v1) + } + 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)() + } + } + struct Next1 + where + T: std::future::Future, + { + s_0: app_40ab089d::Scoped, + next: fn(app_40ab089d::Scoped) -> T, + } + impl std::future::IntoFuture for Next1 + where + T: std::future::Future, + { + type Output = pavex::response::Response; + type IntoFuture = T; + fn into_future(self) -> Self::IntoFuture { + (self.next)(self.s_0) + } + } + struct Next2 + where + T: std::future::Future, + { + s_0: app_40ab089d::Scoped, + next: fn(app_40ab089d::Scoped) -> T, + } + impl std::future::IntoFuture for Next2 + where + T: std::future::Future, + { + type Output = pavex::response::Response; + type IntoFuture = T; + fn into_future(self) -> Self::IntoFuture { + (self.next)(self.s_0) + } + } +} +pub mod route_1 { + 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 = wrapping_1(s_0).await; + response + } + async fn stage_2<'a, 'b>( + s_0: &'a pavex::router::AllowedMethods, + s_1: &'b app_40ab089d::Scoped, + ) -> pavex::response::Response { + let response = wrapping_2(s_0, s_1).await; + response + } + async fn stage_3<'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_1::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 wrapping_1( + v0: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v1 = app_40ab089d::Scoped::new(); + let v2 = crate::route_1::Next1 { + s_0: v0, + s_1: &v1, + next: stage_2, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = ::clone(&v1); + let v5 = app_40ab089d::mw(v4, v3); + ::into_response(v5) + } + async fn wrapping_2( + v0: &pavex::router::AllowedMethods, + v1: &app_40ab089d::Scoped, + ) -> pavex::response::Response { + let v2 = crate::route_1::Next2 { + s_0: v0, + next: stage_3, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = app_40ab089d::mw2(v1, v3); + ::into_response(v4) + } + 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) + } + } + struct Next1<'a, 'b, T> + where + T: std::future::Future, + { + s_0: &'a pavex::router::AllowedMethods, + s_1: &'b app_40ab089d::Scoped, + next: fn(&'a pavex::router::AllowedMethods, &'b app_40ab089d::Scoped) -> T, + } + impl<'a, 'b, T> std::future::IntoFuture for Next1<'a, 'b, 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, self.s_1) + } + } + struct Next2<'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 Next2<'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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/lib.rs b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/lib.rs rename to libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/main.rs b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/main.rs new file mode 100644 index 000000000..e16566057 --- /dev/null +++ b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_40ab089d::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/test_config.toml b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/test_config.toml rename to libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/test_config.toml diff --git a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/Cargo.toml b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/Cargo.toml new file mode 100644 index 000000000..4f01faefc --- /dev/null +++ b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_ddc3d7f1" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/diagnostics.dot b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/diagnostics.dot new file mode 100644 index 000000000..a46484795 --- /dev/null +++ b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/diagnostics.dot @@ -0,0 +1,47 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a app_ddc3d7f1::A) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_ddc3d7f1::A"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_ddc3d7f1::handler::(app_ddc3d7f1::Generic<''a>) -> http::StatusCode"] + 1 [ label = "app_ddc3d7f1::Generic::new(&''a app_ddc3d7f1::A) -> app_ddc3d7f1::Generic<'a>"] + 3 [ label = "::into_response(http::StatusCode) -> pavex::response::Response"] + 4 [ label = "&app_ddc3d7f1::A"] + 1 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 1 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_ddc3d7f1::A) -> crate::ApplicationState"] + 1 [ label = "app_ddc3d7f1::A::new() -> app_ddc3d7f1::A"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/app.rs b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/app.rs rename to libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/diagnostics.dot b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/diagnostics.dot rename to libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/stderr.txt b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/stderr.txt rename to libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/expectations/stderr.txt diff --git a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml new file mode 100644 index 000000000..30d0461db --- /dev/null +++ b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_ddc3d7f1" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_ddc3d7f1 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/blueprint.ron new file mode 100644 index 000000000..8d67eb553 --- /dev/null +++ b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 26, + column: 18, + file: "dependency_injection/elided_lifetimes_are_handled/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ddc3d7f1", + module_path: "app_ddc3d7f1", + ), + import_path: "self::A::new", + ), + location: ( + line: 27, + column: 8, + file: "dependency_injection/elided_lifetimes_are_handled/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ddc3d7f1", + module_path: "app_ddc3d7f1", + ), + import_path: "self::Generic::new", + ), + location: ( + line: 28, + column: 8, + file: "dependency_injection/elided_lifetimes_are_handled/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ddc3d7f1", + module_path: "app_ddc3d7f1", + ), + import_path: "self::handler::", + ), + location: ( + line: 29, + column: 8, + file: "dependency_injection/elided_lifetimes_are_handled/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/src/lib.rs new file mode 100644 index 000000000..1537b95a8 --- /dev/null +++ b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/src/lib.rs @@ -0,0 +1,161 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_ddc3d7f1::A, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_ddc3d7f1::A::new(); + crate::ApplicationState { s0: v0 } +} +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("/", 0u32).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_1::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::GET => { + route_0::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>(s_0: &'a app_ddc3d7f1::A) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>(s_0: &'a app_ddc3d7f1::A) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: &app_ddc3d7f1::A) -> pavex::response::Response { + let v1 = crate::route_0::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: &app_ddc3d7f1::A) -> pavex::response::Response { + let v2 = { + let v1 = app_ddc3d7f1::Generic::new(v0); + app_ddc3d7f1::handler::(v1) + }; + ::into_response(v2) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_ddc3d7f1::A, + next: fn(&'a app_ddc3d7f1::A) -> 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) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/elided_lifetimes_are_handled/lib.rs b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/elided_lifetimes_are_handled/lib.rs rename to libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/src/main.rs b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/src/main.rs new file mode 100644 index 000000000..c0c1ba9a8 --- /dev/null +++ b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ddc3d7f1::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/elided_lifetimes_are_handled/test_config.toml b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/elided_lifetimes_are_handled/test_config.toml rename to libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/test_config.toml diff --git a/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/Cargo.toml b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/Cargo.toml new file mode 100644 index 000000000..8193a3d63 --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_d408236b" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/expectations/stderr.txt b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/expectations/stderr.txt rename to libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/expectations/stderr.txt diff --git a/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/Cargo.toml new file mode 100644 index 000000000..102bdfdf5 --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_d408236b" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/blueprint.ron new file mode 100644 index 000000000..fa5553aa3 --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 24, + column: 18, + file: "dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d408236b", + module_path: "app_d408236b", + ), + import_path: "crate::a", + ), + location: ( + line: 25, + column: 8, + file: "dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d408236b", + module_path: "app_d408236b", + ), + import_path: "crate::b", + ), + location: ( + line: 26, + column: 8, + file: "dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_d408236b", + module_path: "app_d408236b", + ), + import_path: "crate::handler", + ), + location: ( + line: 27, + column: 8, + file: "dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/lib.rs b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/lib.rs rename to libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/main.rs b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/main.rs new file mode 100644 index 000000000..187300a79 --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_d408236b::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/test_config.toml b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/test_config.toml rename to libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/test_config.toml diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/Cargo.toml b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/Cargo.toml new file mode 100644 index 000000000..ba84d47ee --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_7c78acb2" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/expectations/stderr.txt b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/expectations/stderr.txt rename to libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/expectations/stderr.txt diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/Cargo.toml new file mode 100644 index 000000000..53005a5cb --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_7c78acb2" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/blueprint.ron new file mode 100644 index 000000000..ec41b92e4 --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 29, + column: 18, + file: "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_7c78acb2", + module_path: "app_7c78acb2", + ), + import_path: "crate::a", + ), + location: ( + line: 30, + column: 8, + file: "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_7c78acb2", + module_path: "app_7c78acb2", + ), + import_path: "crate::b", + ), + location: ( + line: 31, + column: 8, + file: "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_7c78acb2", + module_path: "app_7c78acb2", + ), + import_path: "crate::c", + ), + location: ( + line: 32, + column: 8, + file: "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_7c78acb2", + module_path: "app_7c78acb2", + ), + import_path: "crate::handler", + ), + location: ( + line: 33, + column: 8, + file: "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/lib.rs b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/lib.rs rename to libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/main.rs b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/main.rs new file mode 100644 index 000000000..c4fbfd594 --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_7c78acb2::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/test_config.toml b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/test_config.toml rename to libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/test_config.toml diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/Cargo.toml b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/Cargo.toml new file mode 100644 index 000000000..3d4b496b5 --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_381916a7" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/expectations/stderr.txt b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/expectations/stderr.txt rename to libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/expectations/stderr.txt diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/Cargo.toml new file mode 100644 index 000000000..7af7af895 --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_381916a7" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/blueprint.ron new file mode 100644 index 000000000..479f36bf5 --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 25, + column: 18, + file: "dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_381916a7", + module_path: "app_381916a7", + ), + import_path: "self::a", + ), + location: ( + line: 26, + column: 8, + file: "dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_381916a7", + module_path: "app_381916a7", + ), + import_path: "self::B::new", + ), + location: ( + line: 27, + column: 8, + file: "dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: Some(CloneIfNecessary), + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_381916a7", + module_path: "app_381916a7", + ), + import_path: "self::handler", + ), + location: ( + line: 28, + column: 8, + file: "dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/lib.rs b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/lib.rs rename to libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/main.rs b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/main.rs new file mode 100644 index 000000000..0460812f9 --- /dev/null +++ b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_381916a7::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/test_config.toml b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/test_config.toml rename to libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/test_config.toml diff --git a/libs/ui_tests/dependency_injection/missing_handler_dependency/Cargo.toml b/libs/ui_tests/dependency_injection/missing_handler_dependency/Cargo.toml new file mode 100644 index 000000000..2acd0a568 --- /dev/null +++ b/libs/ui_tests/dependency_injection/missing_handler_dependency/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_ce0a2170" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_handler_dependency/expectations/stderr.txt b/libs/ui_tests/dependency_injection/missing_handler_dependency/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/missing_handler_dependency/expectations/stderr.txt rename to libs/ui_tests/dependency_injection/missing_handler_dependency/expectations/stderr.txt diff --git a/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/Cargo.toml new file mode 100644 index 000000000..cad7243b0 --- /dev/null +++ b/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_ce0a2170" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/blueprint.ron new file mode 100644 index 000000000..cc86c5788 --- /dev/null +++ b/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/blueprint.ron @@ -0,0 +1,30 @@ +( + creation_location: ( + line: 11, + column: 18, + file: "dependency_injection/missing_handler_dependency/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ce0a2170", + module_path: "app_ce0a2170", + ), + import_path: "crate::stream_file", + ), + location: ( + line: 12, + column: 8, + file: "dependency_injection/missing_handler_dependency/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_handler_dependency/lib.rs b/libs/ui_tests/dependency_injection/missing_handler_dependency/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/missing_handler_dependency/lib.rs rename to libs/ui_tests/dependency_injection/missing_handler_dependency/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/missing_handler_dependency/src/main.rs b/libs/ui_tests/dependency_injection/missing_handler_dependency/src/main.rs new file mode 100644 index 000000000..e4f01bf0a --- /dev/null +++ b/libs/ui_tests/dependency_injection/missing_handler_dependency/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ce0a2170::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_handler_dependency/test_config.toml b/libs/ui_tests/dependency_injection/missing_handler_dependency/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/missing_handler_dependency/test_config.toml rename to libs/ui_tests/dependency_injection/missing_handler_dependency/test_config.toml diff --git a/libs/ui_tests/dependency_injection/missing_singleton_dependency/Cargo.toml b/libs/ui_tests/dependency_injection/missing_singleton_dependency/Cargo.toml new file mode 100644 index 000000000..902fcac66 --- /dev/null +++ b/libs/ui_tests/dependency_injection/missing_singleton_dependency/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_67306117" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_singleton_dependency/expectations/stderr.txt b/libs/ui_tests/dependency_injection/missing_singleton_dependency/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/missing_singleton_dependency/expectations/stderr.txt rename to libs/ui_tests/dependency_injection/missing_singleton_dependency/expectations/stderr.txt diff --git a/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/Cargo.toml new file mode 100644 index 000000000..d5dedc7cb --- /dev/null +++ b/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_67306117" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/blueprint.ron new file mode 100644 index 000000000..28b3ad2cf --- /dev/null +++ b/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 20, + column: 18, + file: "dependency_injection/missing_singleton_dependency/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_67306117", + module_path: "app_67306117", + ), + import_path: "crate::b", + ), + location: ( + line: 21, + column: 8, + file: "dependency_injection/missing_singleton_dependency/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_67306117", + module_path: "app_67306117", + ), + import_path: "crate::handler", + ), + location: ( + line: 22, + column: 8, + file: "dependency_injection/missing_singleton_dependency/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_singleton_dependency/lib.rs b/libs/ui_tests/dependency_injection/missing_singleton_dependency/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/missing_singleton_dependency/lib.rs rename to libs/ui_tests/dependency_injection/missing_singleton_dependency/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/missing_singleton_dependency/src/main.rs b/libs/ui_tests/dependency_injection/missing_singleton_dependency/src/main.rs new file mode 100644 index 000000000..fa66691a7 --- /dev/null +++ b/libs/ui_tests/dependency_injection/missing_singleton_dependency/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_67306117::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/missing_singleton_dependency/test_config.toml b/libs/ui_tests/dependency_injection/missing_singleton_dependency/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/missing_singleton_dependency/test_config.toml rename to libs/ui_tests/dependency_injection/missing_singleton_dependency/test_config.toml diff --git a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/Cargo.toml b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/Cargo.toml new file mode 100644 index 000000000..164c3b26e --- /dev/null +++ b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_8b5f0867" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/diagnostics.dot b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/diagnostics.dot new file mode 100644 index 000000000..e1338696c --- /dev/null +++ b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/diagnostics.dot @@ -0,0 +1,97 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a app_8b5f0867::Singleton) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_8b5f0867::Singleton"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_8b5f0867::wrap(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next1<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next1(&'a app_8b5f0867::RequestScoped) -> crate::route_0::Next1<'a>"] + 3 [ label = "app_8b5f0867::request_scoped(&app_8b5f0867::Singleton) -> app_8b5f0867::RequestScoped"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&app_8b5f0867::Singleton"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ label = "&"] + 0 -> 5 [ ] + 6 -> 3 [ ] +} + +digraph "GET / - 2" { + 0 [ label = "app_8b5f0867::handler(&app_8b5f0867::RequestScoped) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&app_8b5f0867::RequestScoped"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET / - 3" { + 0 [ label = "app_8b5f0867::post(pavex::response::Response, &app_8b5f0867::RequestScoped) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&app_8b5f0867::RequestScoped"] + 1 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a, 'b>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a app_8b5f0867::Singleton, &'b pavex::router::AllowedMethods) -> crate::route_1::Next0<'a, 'b>"] + 3 [ label = "&pavex::router::AllowedMethods"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&app_8b5f0867::Singleton"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 5 [ ] + 6 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "app_8b5f0867::wrap(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next1<'a, 'b>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next1(&'a app_8b5f0867::Singleton, &'b pavex::router::AllowedMethods) -> crate::route_1::Next1<'a, 'b>"] + 3 [ label = "&pavex::router::AllowedMethods"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&app_8b5f0867::Singleton"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 5 [ ] + 6 -> 2 [ ] +} + +digraph "* / - 2" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* / - 3" { + 0 [ label = "app_8b5f0867::post(pavex::response::Response, &app_8b5f0867::RequestScoped) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 2 [ label = "app_8b5f0867::request_scoped(&app_8b5f0867::Singleton) -> app_8b5f0867::RequestScoped"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_8b5f0867::Singleton"] + 1 -> 0 [ ] + 2 -> 0 [ label = "&"] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_8b5f0867::Singleton) -> crate::ApplicationState"] + 1 [ label = "app_8b5f0867::Singleton::new() -> app_8b5f0867::Singleton"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/app.rs b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/app.rs rename to libs/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/diagnostics.dot b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/diagnostics.dot rename to libs/ui_tests/dependency_injection/next_state_is_populated_correctly/expectations/diagnostics.dot diff --git a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml new file mode 100644 index 000000000..74a40b2bf --- /dev/null +++ b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_8b5f0867" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_8b5f0867 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/blueprint.ron new file mode 100644 index 000000000..4101f6c82 --- /dev/null +++ b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/blueprint.ron @@ -0,0 +1,104 @@ +( + creation_location: ( + line: 35, + column: 18, + file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_8b5f0867", + module_path: "app_8b5f0867", + ), + import_path: "crate::Singleton::new", + ), + location: ( + line: 36, + column: 8, + file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_8b5f0867", + module_path: "app_8b5f0867", + ), + import_path: "crate::request_scoped", + ), + location: ( + line: 37, + column: 8, + file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_8b5f0867", + module_path: "app_8b5f0867", + ), + import_path: "crate::wrap", + ), + location: ( + line: 38, + column: 8, + file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_8b5f0867", + module_path: "app_8b5f0867", + ), + import_path: "crate::post", + ), + location: ( + line: 39, + column: 8, + file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_8b5f0867", + module_path: "app_8b5f0867", + ), + import_path: "crate::handler", + ), + location: ( + line: 40, + column: 8, + file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/src/lib.rs new file mode 100644 index 000000000..669ab5ef5 --- /dev/null +++ b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/src/lib.rs @@ -0,0 +1,261 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_8b5f0867::Singleton, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_8b5f0867::Singleton::new(); + crate::ApplicationState { s0: v0 } +} +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("/", 0u32).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_1::entrypoint( + &allowed_methods, + &server_state.application_state.s0, + ) + .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::GET => { + route_0::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint( + &allowed_methods, + &server_state.application_state.s0, + ) + .await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>( + s_0: &'a app_8b5f0867::Singleton, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>(s_0: &'a app_8b5f0867::Singleton) -> pavex::response::Response { + let response = wrapping_1(s_0).await; + response + } + async fn stage_2<'a>( + s_0: &'a app_8b5f0867::RequestScoped, + ) -> pavex::response::Response { + let response = handler(s_0).await; + let response = post_processing_0(response, s_0).await; + response + } + async fn wrapping_0(v0: &app_8b5f0867::Singleton) -> pavex::response::Response { + let v1 = crate::route_0::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 wrapping_1(v0: &app_8b5f0867::Singleton) -> pavex::response::Response { + let v1 = app_8b5f0867::request_scoped(v0); + let v2 = crate::route_0::Next1 { + s_0: &v1, + next: stage_2, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = app_8b5f0867::wrap(v3); + ::into_response(v4) + } + async fn handler(v0: &app_8b5f0867::RequestScoped) -> pavex::response::Response { + let v1 = app_8b5f0867::handler(v0); + ::into_response(v1) + } + async fn post_processing_0( + v0: pavex::response::Response, + v1: &app_8b5f0867::RequestScoped, + ) -> pavex::response::Response { + let v2 = app_8b5f0867::post(v0, v1); + ::into_response(v2) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_8b5f0867::Singleton, + next: fn(&'a app_8b5f0867::Singleton) -> 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) + } + } + struct Next1<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_8b5f0867::RequestScoped, + next: fn(&'a app_8b5f0867::RequestScoped) -> T, + } + impl<'a, T> std::future::IntoFuture for Next1<'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) + } + } +} +pub mod route_1 { + pub async fn entrypoint<'a, 'b>( + s_0: &'a pavex::router::AllowedMethods, + s_1: &'b app_8b5f0867::Singleton, + ) -> pavex::response::Response { + let response = wrapping_0(s_0, s_1).await; + response + } + async fn stage_1<'a, 'b>( + s_0: &'a app_8b5f0867::Singleton, + s_1: &'b pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let response = wrapping_1(s_1, s_0).await; + response + } + async fn stage_2<'a, 'b>( + s_0: &'a app_8b5f0867::Singleton, + s_1: &'b pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let response = handler(s_1).await; + let response = post_processing_0(response, s_0).await; + response + } + async fn wrapping_0( + v0: &pavex::router::AllowedMethods, + v1: &app_8b5f0867::Singleton, + ) -> pavex::response::Response { + let v2 = crate::route_1::Next0 { + s_0: v1, + s_1: v0, + next: stage_1, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = pavex::middleware::wrap_noop(v3).await; + ::into_response(v4) + } + async fn wrapping_1( + v0: &pavex::router::AllowedMethods, + v1: &app_8b5f0867::Singleton, + ) -> pavex::response::Response { + let v2 = crate::route_1::Next1 { + s_0: v1, + s_1: v0, + next: stage_2, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = app_8b5f0867::wrap(v3); + ::into_response(v4) + } + async fn handler(v0: &pavex::router::AllowedMethods) -> pavex::response::Response { + let v1 = pavex::router::default_fallback(v0).await; + ::into_response(v1) + } + async fn post_processing_0( + v0: pavex::response::Response, + v1: &app_8b5f0867::Singleton, + ) -> pavex::response::Response { + let v2 = app_8b5f0867::request_scoped(v1); + let v3 = app_8b5f0867::post(v0, &v2); + ::into_response(v3) + } + struct Next0<'a, 'b, T> + where + T: std::future::Future, + { + s_0: &'a app_8b5f0867::Singleton, + s_1: &'b pavex::router::AllowedMethods, + next: fn(&'a app_8b5f0867::Singleton, &'b pavex::router::AllowedMethods) -> T, + } + impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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, self.s_1) + } + } + struct Next1<'a, 'b, T> + where + T: std::future::Future, + { + s_0: &'a app_8b5f0867::Singleton, + s_1: &'b pavex::router::AllowedMethods, + next: fn(&'a app_8b5f0867::Singleton, &'b pavex::router::AllowedMethods) -> T, + } + impl<'a, 'b, T> std::future::IntoFuture for Next1<'a, 'b, 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, self.s_1) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/lib.rs b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/lib.rs rename to libs/ui_tests/dependency_injection/next_state_is_populated_correctly/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/src/main.rs b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/src/main.rs new file mode 100644 index 000000000..fe31f62a3 --- /dev/null +++ b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_8b5f0867::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/test_config.toml b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/next_state_is_populated_correctly/test_config.toml rename to libs/ui_tests/dependency_injection/next_state_is_populated_correctly/test_config.toml diff --git a/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/Cargo.toml b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/Cargo.toml new file mode 100644 index 000000000..f10070206 --- /dev/null +++ b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_f1383503" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/app.rs b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/app.rs rename to libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/diagnostics.dot b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/diagnostics.dot rename to libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/stderr.txt b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/stderr.txt rename to libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/expectations/stderr.txt diff --git a/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/Cargo.toml new file mode 100644 index 000000000..fa30ae30a --- /dev/null +++ b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_f1383503" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/blueprint.ron new file mode 100644 index 000000000..a2c3c9832 --- /dev/null +++ b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 18, + column: 18, + file: "dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_f1383503", + module_path: "app_f1383503", + ), + import_path: "crate::tied", + ), + location: ( + line: 19, + column: 8, + file: "dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_f1383503", + module_path: "app_f1383503", + ), + import_path: "crate::handler", + ), + location: ( + line: 20, + column: 8, + file: "dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/lib.rs b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/lib.rs rename to libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/main.rs b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/main.rs new file mode 100644 index 000000000..7e3c2c6d7 --- /dev/null +++ b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_f1383503::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/test_config.toml b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/test_config.toml rename to libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/test_config.toml diff --git a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/Cargo.toml b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/Cargo.toml new file mode 100644 index 000000000..4f745ba62 --- /dev/null +++ b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_c266691d" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/diagnostics.dot b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/diagnostics.dot new file mode 100644 index 000000000..6bd82e288 --- /dev/null +++ b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/diagnostics.dot @@ -0,0 +1,49 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a app_c266691d::Singleton) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_c266691d::Singleton"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_c266691d::stream_file(&app_c266691d::Singleton, &app_c266691d::RequestScoped, &app_c266691d::Transient) -> pavex::response::Response"] + 2 [ label = "app_c266691d::request_scoped() -> app_c266691d::RequestScoped"] + 3 [ label = "app_c266691d::transient() -> app_c266691d::Transient"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_c266691d::Singleton"] + 3 -> 0 [ label = "&"] + 2 -> 0 [ label = "&"] + 0 -> 4 [ ] + 5 -> 0 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_c266691d::Singleton) -> crate::ApplicationState"] + 1 [ label = "app_c266691d::Singleton::new() -> app_c266691d::Singleton"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/app.rs b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/app.rs rename to libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/diagnostics.dot b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/diagnostics.dot rename to libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/expectations/diagnostics.dot diff --git a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml new file mode 100644 index 000000000..f97db0a20 --- /dev/null +++ b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_c266691d" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_c266691d = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/blueprint.ron new file mode 100644 index 000000000..75dfaec5f --- /dev/null +++ b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 30, + column: 18, + file: "dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c266691d", + module_path: "app_c266691d", + ), + import_path: "crate::Singleton::new", + ), + location: ( + line: 31, + column: 8, + file: "dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c266691d", + module_path: "app_c266691d", + ), + import_path: "crate::request_scoped", + ), + location: ( + line: 32, + column: 8, + file: "dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c266691d", + module_path: "app_c266691d", + ), + import_path: "crate::transient", + ), + location: ( + line: 33, + column: 8, + file: "dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c266691d", + module_path: "app_c266691d", + ), + import_path: "crate::stream_file", + ), + location: ( + line: 34, + column: 8, + file: "dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/src/lib.rs new file mode 100644 index 000000000..0f47cfc24 --- /dev/null +++ b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/src/lib.rs @@ -0,0 +1,164 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_c266691d::Singleton, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_c266691d::Singleton::new(); + crate::ApplicationState { s0: v0 } +} +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("/home", 0u32).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_1::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::GET => { + route_0::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>( + s_0: &'a app_c266691d::Singleton, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>(s_0: &'a app_c266691d::Singleton) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: &app_c266691d::Singleton) -> pavex::response::Response { + let v1 = crate::route_0::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: &app_c266691d::Singleton) -> pavex::response::Response { + let v1 = app_c266691d::request_scoped(); + let v3 = { + let v2 = app_c266691d::transient(); + app_c266691d::stream_file(v0, &v1, &v2) + }; + ::into_response(v3) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_c266691d::Singleton, + next: fn(&'a app_c266691d::Singleton) -> 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) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/lib.rs b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/lib.rs rename to libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/src/main.rs b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/src/main.rs new file mode 100644 index 000000000..298a56618 --- /dev/null +++ b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_c266691d::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/test_config.toml b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/test_config.toml rename to libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/test_config.toml diff --git a/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/Cargo.toml b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/Cargo.toml new file mode 100644 index 000000000..01f01875b --- /dev/null +++ b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_d238c5d8" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/some_types_cannot_be_constructed/expectations/stderr.txt b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/some_types_cannot_be_constructed/expectations/stderr.txt rename to libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/expectations/stderr.txt diff --git a/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/Cargo.toml new file mode 100644 index 000000000..f14dee838 --- /dev/null +++ b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_d238c5d8" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/blueprint.ron new file mode 100644 index 000000000..d9befcdbf --- /dev/null +++ b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/blueprint.ron @@ -0,0 +1,343 @@ +( + creation_location: ( + line: 73, + column: 18, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + components: [ + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 75, + column: 22, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::error", + ), + location: ( + line: 76, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::response", + ), + location: ( + line: 77, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::request_head", + ), + location: ( + line: 78, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::allowed_methods", + ), + location: ( + line: 79, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::raw_incoming_body", + ), + location: ( + line: 80, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::matched_path_pattern", + ), + location: ( + line: 81, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::raw_path_params", + ), + location: ( + line: 82, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::connection_info", + ), + location: ( + line: 83, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 74, + column: 8, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 87, + column: 22, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::error_ref", + ), + location: ( + line: 88, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::response_ref", + ), + location: ( + line: 89, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::request_head_ref", + ), + location: ( + line: 90, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::allowed_methods_ref", + ), + location: ( + line: 91, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::raw_incoming_body_ref", + ), + location: ( + line: 92, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::matched_path_pattern_ref", + ), + location: ( + line: 93, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d238c5d8", + module_path: "app_d238c5d8", + ), + import_path: "crate::raw_path_params_ref", + ), + location: ( + line: 97, + column: 12, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 86, + column: 8, + file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/some_types_cannot_be_constructed/lib.rs b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/some_types_cannot_be_constructed/lib.rs rename to libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/src/lib.rs diff --git a/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/src/main.rs b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/src/main.rs new file mode 100644 index 000000000..097e6776f --- /dev/null +++ b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_d238c5d8::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/dependency_injection/some_types_cannot_be_constructed/test_config.toml b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/dependency_injection/some_types_cannot_be_constructed/test_config.toml rename to libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/test_config.toml diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/Cargo.toml b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/Cargo.toml new file mode 100644 index 000000000..8e780e430 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_f6a54ba5" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/app.rs b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/app.rs rename to libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/diagnostics.dot b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/diagnostics.dot rename to libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/stderr.txt b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/stderr.txt rename to libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/expectations/stderr.txt diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/Cargo.toml new file mode 100644 index 000000000..611e59ba0 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_f6a54ba5" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/blueprint.ron b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/blueprint.ron new file mode 100644 index 000000000..a220436f0 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/blueprint.ron @@ -0,0 +1,112 @@ +( + creation_location: ( + line: 41, + column: 18, + file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_f6a54ba5", + module_path: "app_f6a54ba5", + ), + import_path: "crate::a", + ), + location: ( + line: 42, + column: 8, + file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_f6a54ba5", + module_path: "app_f6a54ba5", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 43, + column: 10, + file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", + ), + )), + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_f6a54ba5", + module_path: "app_f6a54ba5", + ), + import_path: "crate::b", + ), + location: ( + line: 44, + column: 8, + file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_f6a54ba5", + module_path: "app_f6a54ba5", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 45, + column: 10, + file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", + ), + )), + lints: {}, + )), + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_f6a54ba5", + module_path: "app_f6a54ba5", + ), + import_path: "crate::error_observer", + ), + location: ( + line: 46, + column: 8, + file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", + ), + ), + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_f6a54ba5", + module_path: "app_f6a54ba5", + ), + import_path: "crate::handler", + ), + location: ( + line: 47, + column: 8, + file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/lib.rs b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/lib.rs rename to libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/main.rs b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/main.rs new file mode 100644 index 000000000..5f5046b51 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_f6a54ba5::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/test_config.toml b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/test_config.toml rename to libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/test_config.toml diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/Cargo.toml b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/Cargo.toml new file mode 100644 index 000000000..7a67308db --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_01bbcc3d" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/app.rs b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/app.rs rename to libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/diagnostics.dot b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/diagnostics.dot rename to libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/stderr.txt b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/stderr.txt rename to libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/expectations/stderr.txt diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/Cargo.toml new file mode 100644 index 000000000..b22b78278 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_01bbcc3d" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/blueprint.ron b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/blueprint.ron new file mode 100644 index 000000000..b020691db --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/blueprint.ron @@ -0,0 +1,132 @@ +( + creation_location: ( + line: 46, + column: 18, + file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_01bbcc3d", + module_path: "app_01bbcc3d", + ), + import_path: "crate::a", + ), + location: ( + line: 47, + column: 8, + file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_01bbcc3d", + module_path: "app_01bbcc3d", + ), + import_path: "crate::b", + ), + location: ( + line: 48, + column: 8, + file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_01bbcc3d", + module_path: "app_01bbcc3d", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 49, + column: 10, + file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", + ), + )), + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_01bbcc3d", + module_path: "app_01bbcc3d", + ), + import_path: "crate::c", + ), + location: ( + line: 50, + column: 8, + file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_01bbcc3d", + module_path: "app_01bbcc3d", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 51, + column: 10, + file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", + ), + )), + lints: {}, + )), + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_01bbcc3d", + module_path: "app_01bbcc3d", + ), + import_path: "crate::error_observer", + ), + location: ( + line: 52, + column: 8, + file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", + ), + ), + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_01bbcc3d", + module_path: "app_01bbcc3d", + ), + import_path: "crate::handler", + ), + location: ( + line: 53, + column: 8, + file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/lib.rs b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/lib.rs rename to libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/main.rs b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/main.rs new file mode 100644 index 000000000..6f745c619 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_01bbcc3d::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/test_config.toml b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/test_config.toml rename to libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/test_config.toml diff --git a/libs/ui_tests/error_observers/error_observer_with_generic_error/Cargo.toml b/libs/ui_tests/error_observers/error_observer_with_generic_error/Cargo.toml new file mode 100644 index 000000000..23d24d1a3 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_with_generic_error/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_00ed62be" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/error_observers/error_observer_with_generic_error/diagnostics.dot b/libs/ui_tests/error_observers/error_observer_with_generic_error/diagnostics.dot new file mode 100644 index 000000000..822957dca --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_with_generic_error/diagnostics.dot @@ -0,0 +1,56 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_00ed62be::handler(app_00ed62be::Generic) -> pavex::response::Response"] + 1 [ label = "core::prelude::rust_2015::Result, app_00ed62be::GenericError> -> app_00ed62be::Generic"] + 2 [ label = "app_00ed62be::constructor() -> core::prelude::rust_2015::Result, app_00ed62be::GenericError>"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "core::prelude::rust_2015::Result, app_00ed62be::GenericError> -> app_00ed62be::GenericError"] + 5 [ label = "pavex::Error::new(app_00ed62be::GenericError) -> pavex::Error"] + 6 [ label = "app_00ed62be::error_handler(&app_00ed62be::GenericError) -> pavex::response::Response"] + 7 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 8 [ label = "app_00ed62be::error_observer(&pavex::Error)"] + 9 [ label = "`match`"] + 1 -> 0 [ ] + 9 -> 4 [ ] + 9 -> 1 [ ] + 0 -> 3 [ ] + 4 -> 6 [ label = "&"] + 4 -> 5 [ ] + 6 -> 7 [ ] + 5 -> 8 [ label = "&"] + 8 -> 7 [ label = "happens before"] + 2 -> 9 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_with_generic_error/expectations/app.rs b/libs/ui_tests/error_observers/error_observer_with_generic_error/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_with_generic_error/expectations/app.rs rename to libs/ui_tests/error_observers/error_observer_with_generic_error/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_with_generic_error/expectations/diagnostics.dot b/libs/ui_tests/error_observers/error_observer_with_generic_error/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_with_generic_error/expectations/diagnostics.dot rename to libs/ui_tests/error_observers/error_observer_with_generic_error/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_with_generic_error/expectations/stderr.txt b/libs/ui_tests/error_observers/error_observer_with_generic_error/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_with_generic_error/expectations/stderr.txt rename to libs/ui_tests/error_observers/error_observer_with_generic_error/expectations/stderr.txt diff --git a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml new file mode 100644 index 000000000..377c26aae --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_00ed62be" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_00ed62be = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/blueprint.ron b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/blueprint.ron new file mode 100644 index 000000000..07944a281 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/blueprint.ron @@ -0,0 +1,79 @@ +( + creation_location: ( + line: 40, + column: 18, + file: "error_observers/error_observer_with_generic_error/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_00ed62be", + module_path: "app_00ed62be", + ), + import_path: "crate::constructor", + ), + location: ( + line: 41, + column: 8, + file: "error_observers/error_observer_with_generic_error/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_00ed62be", + module_path: "app_00ed62be", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 42, + column: 10, + file: "error_observers/error_observer_with_generic_error/src/lib.rs", + ), + )), + lints: {}, + )), + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_00ed62be", + module_path: "app_00ed62be", + ), + import_path: "crate::error_observer", + ), + location: ( + line: 43, + column: 8, + file: "error_observers/error_observer_with_generic_error/src/lib.rs", + ), + ), + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_00ed62be", + module_path: "app_00ed62be", + ), + import_path: "crate::handler", + ), + location: ( + line: 44, + column: 8, + file: "error_observers/error_observer_with_generic_error/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/src/lib.rs new file mode 100644 index 000000000..cbcce5a9a --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/src/lib.rs @@ -0,0 +1,166 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_00ed62be::constructor(); + let v1 = match v0 { + Ok(ok) => ok, + Err(v1) => { + return { + let v2 = app_00ed62be::error_handler(&v1); + let v3 = pavex::Error::new(v1); + app_00ed62be::error_observer(&v3); + ::into_response( + v2, + ) + }; + } + }; + let v2 = app_00ed62be::handler(v1); + ::into_response(v2) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_with_generic_error/lib.rs b/libs/ui_tests/error_observers/error_observer_with_generic_error/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_with_generic_error/lib.rs rename to libs/ui_tests/error_observers/error_observer_with_generic_error/src/lib.rs diff --git a/libs/ui_tests/error_observers/error_observer_with_generic_error/src/main.rs b/libs/ui_tests/error_observers/error_observer_with_generic_error/src/main.rs new file mode 100644 index 000000000..b003e00ee --- /dev/null +++ b/libs/ui_tests/error_observers/error_observer_with_generic_error/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_00ed62be::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observer_with_generic_error/test_config.toml b/libs/ui_tests/error_observers/error_observer_with_generic_error/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observer_with_generic_error/test_config.toml rename to libs/ui_tests/error_observers/error_observer_with_generic_error/test_config.toml diff --git a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/Cargo.toml b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/Cargo.toml new file mode 100644 index 000000000..a10625aef --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_028e5d85" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/diagnostics.dot b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/diagnostics.dot new file mode 100644 index 000000000..97a9d84f0 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/diagnostics.dot @@ -0,0 +1,76 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a app_028e5d85::A) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_028e5d85::A"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_028e5d85::handler(&app_028e5d85::B) -> pavex::response::Response"] + 1 [ label = "core::prelude::rust_2015::Result -> app_028e5d85::B"] + 2 [ label = "app_028e5d85::b(&app_028e5d85::A) -> core::prelude::rust_2015::Result"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "core::prelude::rust_2015::Result -> app_028e5d85::AnError"] + 6 [ label = "pavex::Error::new(app_028e5d85::AnError) -> pavex::Error"] + 7 [ label = "app_028e5d85::error_handler(&app_028e5d85::A, &app_028e5d85::AnError) -> pavex::response::Response"] + 8 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 9 [ label = "app_028e5d85::error_observer(&app_028e5d85::A, &pavex::Error)"] + 10 [ label = "`match`"] + 11 [ label = "&app_028e5d85::A"] + 1 -> 0 [ label = "&"] + 10 -> 5 [ ] + 10 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 7 [ label = "&"] + 5 -> 6 [ ] + 7 -> 8 [ ] + 6 -> 9 [ label = "&"] + 9 -> 8 [ label = "happens before"] + 2 -> 10 [ ] + 11 -> 9 [ ] + 11 -> 7 [ ] + 11 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_028e5d85::A) -> crate::ApplicationState"] + 1 [ label = "core::prelude::rust_2015::Result -> app_028e5d85::A"] + 2 [ label = "app_028e5d85::a() -> core::prelude::rust_2015::Result"] + 3 [ label = "core::result::Result::Ok(crate::ApplicationState) -> core::result::Result"] + 4 [ label = "core::prelude::rust_2015::Result -> app_028e5d85::AnError"] + 5 [ label = "crate::ApplicationStateError::A(app_028e5d85::AnError) -> crate::ApplicationStateError"] + 6 [ label = "core::result::Result::Err(crate::ApplicationStateError) -> core::result::Result"] + 7 [ label = "`match`"] + 1 -> 0 [ ] + 7 -> 4 [ ] + 7 -> 1 [ ] + 0 -> 3 [ ] + 4 -> 5 [ ] + 5 -> 6 [ ] + 2 -> 7 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/app.rs b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/app.rs rename to libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/diagnostics.dot b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/diagnostics.dot rename to libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/stderr.txt b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/stderr.txt rename to libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/expectations/stderr.txt diff --git a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml new file mode 100644 index 000000000..297917791 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_028e5d85" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_028e5d85 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/blueprint.ron b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/blueprint.ron new file mode 100644 index 000000000..1a6c807cb --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/blueprint.ron @@ -0,0 +1,99 @@ +( + creation_location: ( + line: 42, + column: 18, + file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_028e5d85", + module_path: "app_028e5d85", + ), + import_path: "crate::a", + ), + location: ( + line: 43, + column: 8, + file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_028e5d85", + module_path: "app_028e5d85", + ), + import_path: "crate::b", + ), + location: ( + line: 44, + column: 8, + file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_028e5d85", + module_path: "app_028e5d85", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 45, + column: 10, + file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", + ), + )), + lints: {}, + )), + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_028e5d85", + module_path: "app_028e5d85", + ), + import_path: "crate::error_observer", + ), + location: ( + line: 46, + column: 8, + file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", + ), + ), + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_028e5d85", + module_path: "app_028e5d85", + ), + import_path: "crate::handler", + ), + location: ( + line: 47, + column: 8, + file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/src/lib.rs new file mode 100644 index 000000000..ba2b44a4e --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/src/lib.rs @@ -0,0 +1,190 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_028e5d85::A, +} +#[derive(Debug, thiserror::Error)] +pub enum ApplicationStateError { + #[error(transparent)] + A(app_028e5d85::AnError), +} +pub async fn build_application_state() -> Result< + crate::ApplicationState, + crate::ApplicationStateError, +> { + let v0 = app_028e5d85::a(); + let v1 = match v0 { + Ok(ok) => ok, + Err(v1) => { + return { + let v2 = crate::ApplicationStateError::A(v1); + core::result::Result::Err(v2) + }; + } + }; + let v2 = crate::ApplicationState { s0: v1 }; + core::result::Result::Ok(v2) +} +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("/home", 0u32).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_1::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::GET => { + route_0::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>(s_0: &'a app_028e5d85::A) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>(s_0: &'a app_028e5d85::A) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: &app_028e5d85::A) -> pavex::response::Response { + let v1 = crate::route_0::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: &app_028e5d85::A) -> pavex::response::Response { + let v1 = app_028e5d85::b(v0); + let v2 = match v1 { + Ok(ok) => ok, + Err(v2) => { + return { + let v3 = app_028e5d85::error_handler(v0, &v2); + let v4 = pavex::Error::new(v2); + app_028e5d85::error_observer(v0, &v4); + ::into_response( + v3, + ) + }; + } + }; + let v3 = app_028e5d85::handler(&v2); + ::into_response(v3) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_028e5d85::A, + next: fn(&'a app_028e5d85::A) -> 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) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/lib.rs b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/lib.rs rename to libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs diff --git a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/src/main.rs b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/src/main.rs new file mode 100644 index 000000000..c01b65bbc --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_028e5d85::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/test_config.toml b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/test_config.toml rename to libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/test_config.toml diff --git a/libs/ui_tests/error_observers/error_observers_happy_path/Cargo.toml b/libs/ui_tests/error_observers/error_observers_happy_path/Cargo.toml new file mode 100644 index 000000000..cf28ce0bb --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_happy_path/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_0ca8edfa" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/error_observers/error_observers_happy_path/diagnostics.dot b/libs/ui_tests/error_observers/error_observers_happy_path/diagnostics.dot new file mode 100644 index 000000000..0998f9f43 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_happy_path/diagnostics.dot @@ -0,0 +1,63 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_0ca8edfa::handler(&app_0ca8edfa::B) -> pavex::response::Response"] + 1 [ label = "core::prelude::rust_2015::Result -> app_0ca8edfa::B"] + 2 [ label = "app_0ca8edfa::b(&app_0ca8edfa::A) -> core::prelude::rust_2015::Result"] + 3 [ label = "app_0ca8edfa::a() -> app_0ca8edfa::A"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "core::prelude::rust_2015::Result -> app_0ca8edfa::ErrorB"] + 6 [ label = "pavex::Error::new(app_0ca8edfa::ErrorB) -> pavex::Error"] + 7 [ label = "app_0ca8edfa::error_handler(&app_0ca8edfa::A, &app_0ca8edfa::ErrorB) -> pavex::response::Response"] + 8 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 9 [ label = "app_0ca8edfa::error_observer(app_0ca8edfa::A, &pavex::Error)"] + 10 [ label = "app_0ca8edfa::error_observer2(&pavex::Error)"] + 11 [ label = "`match`"] + 1 -> 0 [ label = "&"] + 11 -> 5 [ ] + 3 -> 2 [ label = "&"] + 11 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 7 [ label = "&"] + 3 -> 7 [ label = "&"] + 5 -> 6 [ ] + 7 -> 8 [ ] + 6 -> 9 [ label = "&"] + 9 -> 10 [ label = "happens before"] + 6 -> 10 [ label = "&"] + 10 -> 8 [ label = "happens before"] + 3 -> 9 [ ] + 2 -> 11 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observers_happy_path/expectations/app.rs b/libs/ui_tests/error_observers/error_observers_happy_path/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observers_happy_path/expectations/app.rs rename to libs/ui_tests/error_observers/error_observers_happy_path/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observers_happy_path/expectations/diagnostics.dot b/libs/ui_tests/error_observers/error_observers_happy_path/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observers_happy_path/expectations/diagnostics.dot rename to libs/ui_tests/error_observers/error_observers_happy_path/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observers_happy_path/expectations/stderr.txt b/libs/ui_tests/error_observers/error_observers_happy_path/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observers_happy_path/expectations/stderr.txt rename to libs/ui_tests/error_observers/error_observers_happy_path/expectations/stderr.txt diff --git a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml new file mode 100644 index 000000000..2b3cbc960 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_0ca8edfa" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_0ca8edfa = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/blueprint.ron b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/blueprint.ron new file mode 100644 index 000000000..179b38c78 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/blueprint.ron @@ -0,0 +1,115 @@ +( + creation_location: ( + line: 45, + column: 18, + file: "error_observers/error_observers_happy_path/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_0ca8edfa", + module_path: "app_0ca8edfa", + ), + import_path: "crate::a", + ), + location: ( + line: 46, + column: 8, + file: "error_observers/error_observers_happy_path/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_0ca8edfa", + module_path: "app_0ca8edfa", + ), + import_path: "crate::b", + ), + location: ( + line: 47, + column: 8, + file: "error_observers/error_observers_happy_path/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_0ca8edfa", + module_path: "app_0ca8edfa", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 48, + column: 10, + file: "error_observers/error_observers_happy_path/src/lib.rs", + ), + )), + lints: {}, + )), + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_0ca8edfa", + module_path: "app_0ca8edfa", + ), + import_path: "crate::error_observer", + ), + location: ( + line: 49, + column: 8, + file: "error_observers/error_observers_happy_path/src/lib.rs", + ), + ), + )), + ErrorObserver(( + error_observer: ( + callable: ( + registered_at: ( + crate_name: "app_0ca8edfa", + module_path: "app_0ca8edfa", + ), + import_path: "crate::error_observer2", + ), + location: ( + line: 50, + column: 8, + file: "error_observers/error_observers_happy_path/src/lib.rs", + ), + ), + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_0ca8edfa", + module_path: "app_0ca8edfa", + ), + import_path: "crate::handler", + ), + location: ( + line: 51, + column: 8, + file: "error_observers/error_observers_happy_path/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/src/lib.rs new file mode 100644 index 000000000..782293735 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/src/lib.rs @@ -0,0 +1,170 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_0ca8edfa::a(); + let v1 = app_0ca8edfa::b(&v0); + let v2 = match v1 { + Ok(ok) => ok, + Err(v2) => { + return { + let v3 = app_0ca8edfa::error_handler(&v0, &v2); + let v4 = pavex::Error::new(v2); + { + app_0ca8edfa::error_observer(v0, &v4); + app_0ca8edfa::error_observer2(&v4) + }; + ::into_response( + v3, + ) + }; + } + }; + let v3 = app_0ca8edfa::handler(&v2); + ::into_response(v3) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observers_happy_path/lib.rs b/libs/ui_tests/error_observers/error_observers_happy_path/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observers_happy_path/lib.rs rename to libs/ui_tests/error_observers/error_observers_happy_path/src/lib.rs diff --git a/libs/ui_tests/error_observers/error_observers_happy_path/src/main.rs b/libs/ui_tests/error_observers/error_observers_happy_path/src/main.rs new file mode 100644 index 000000000..d79bca732 --- /dev/null +++ b/libs/ui_tests/error_observers/error_observers_happy_path/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_0ca8edfa::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/error_observers/error_observers_happy_path/test_config.toml b/libs/ui_tests/error_observers/error_observers_happy_path/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/error_observers/error_observers_happy_path/test_config.toml rename to libs/ui_tests/error_observers/error_observers_happy_path/test_config.toml diff --git a/libs/ui_tests/generated_app/Cargo.toml b/libs/ui_tests/generated_app/Cargo.toml new file mode 100644 index 000000000..233407034 --- /dev/null +++ b/libs/ui_tests/generated_app/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "application" +version = "0.1.0" +edition = "2021" + +[dependencies] +app_9717f587 = { version = "0.1.0", path = "../borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches" } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/generated_app/src/lib.rs b/libs/ui_tests/generated_app/src/lib.rs new file mode 100644 index 000000000..39712ae5b --- /dev/null +++ b/libs/ui_tests/generated_app/src/lib.rs @@ -0,0 +1,166 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_9717f587::a(); + let v1 = match v0 { + Ok(ok) => ok, + Err(v1) => { + return { + let v2 = app_9717f587::b(); + let v3 = app_9717f587::error_handler(&v1, v2); + ::into_response( + v3, + ) + }; + } + }; + let v2 = app_9717f587::b(); + let v3 = app_9717f587::handler(v1, v2); + ::into_response(v3) + } + 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<'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_1::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) + } + } +} diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/Cargo.toml b/libs/ui_tests/middlewares/middlewares_execution_order/Cargo.toml new file mode 100644 index 000000000..43496002e --- /dev/null +++ b/libs/ui_tests/middlewares/middlewares_execution_order/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "app_e628417e" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies] +tokio = "1" + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/diagnostics.dot b/libs/ui_tests/middlewares/middlewares_execution_order/diagnostics.dot new file mode 100644 index 000000000..8363484b3 --- /dev/null +++ b/libs/ui_tests/middlewares/middlewares_execution_order/diagnostics.dot @@ -0,0 +1,368 @@ +digraph "GET /after_handler - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_3::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_3::Next0(&'a app_e628417e::Spy) -> crate::route_3::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_e628417e::Spy"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET /after_handler - 1" { + 0 [ label = "app_e628417e::first(&app_e628417e::Spy, pavex::middleware::Next>) -> pavex::response::Response"] + 2 [ label = "pavex::middleware::Next::new(crate::route_3::Next1<'a>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_3::Next1(&'a app_e628417e::Spy) -> crate::route_3::Next1<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] + 5 -> 0 [ ] + 5 -> 3 [ ] +} + +digraph "GET /after_handler - 2" { + 0 [ label = "app_e628417e::first_pre(&app_e628417e::Spy) -> pavex::middleware::Processing"] + 2 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] +} + +digraph "GET /after_handler - 3" { + 0 [ label = "app_e628417e::handler(&app_e628417e::Spy) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&app_e628417e::Spy"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /after_handler - 4" { + 0 [ label = "app_e628417e::first_post(&app_e628417e::Spy, pavex::response::Response) -> pavex::response::Response"] + 2 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "* /after_handler - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a pavex::router::AllowedMethods) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /after_handler - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /early_return - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_2::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_2::Next0(&'a app_e628417e::Spy) -> crate::route_2::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_e628417e::Spy"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET /early_return - 1" { + 0 [ label = "app_e628417e::first(&app_e628417e::Spy, pavex::middleware::Next>) -> pavex::response::Response"] + 2 [ label = "pavex::middleware::Next::new(crate::route_2::Next1<'a>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_2::Next1(&'a app_e628417e::Spy) -> crate::route_2::Next1<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] + 5 -> 0 [ ] + 5 -> 3 [ ] +} + +digraph "GET /early_return - 2" { + 0 [ label = "app_e628417e::early_return_pre(&app_e628417e::Spy) -> pavex::middleware::Processing"] + 2 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] +} + +digraph "GET /early_return - 3" { + 0 [ label = "app_e628417e::second(&app_e628417e::Spy, pavex::middleware::Next>) -> pavex::response::Response"] + 2 [ label = "pavex::middleware::Next::new(crate::route_2::Next2<'a>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_2::Next2(&'a app_e628417e::Spy) -> crate::route_2::Next2<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] + 5 -> 0 [ ] + 5 -> 3 [ ] +} + +digraph "GET /early_return - 4" { + 0 [ label = "app_e628417e::second_pre(&app_e628417e::Spy) -> pavex::middleware::Processing"] + 2 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] +} + +digraph "GET /early_return - 5" { + 0 [ label = "app_e628417e::handler(&app_e628417e::Spy) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&app_e628417e::Spy"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /early_return - 6" { + 0 [ label = "app_e628417e::second_post(&app_e628417e::Spy, pavex::response::Response) -> pavex::response::Response"] + 2 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "GET /early_return - 7" { + 0 [ label = "app_e628417e::first_post(&app_e628417e::Spy, pavex::response::Response) -> pavex::response::Response"] + 2 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "* /early_return - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a pavex::router::AllowedMethods) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /early_return - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /nested - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a app_e628417e::Spy) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_e628417e::Spy"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET /nested - 1" { + 0 [ label = "app_e628417e::first(&app_e628417e::Spy, pavex::middleware::Next>) -> pavex::response::Response"] + 2 [ label = "pavex::middleware::Next::new(crate::route_1::Next1<'a>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_1::Next1(&'a app_e628417e::Spy) -> crate::route_1::Next1<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] + 5 -> 0 [ ] + 5 -> 3 [ ] +} + +digraph "GET /nested - 2" { + 0 [ label = "app_e628417e::first_pre(&app_e628417e::Spy) -> pavex::middleware::Processing"] + 2 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] +} + +digraph "GET /nested - 3" { + 0 [ label = "app_e628417e::second(&app_e628417e::Spy, pavex::middleware::Next>) -> pavex::response::Response"] + 2 [ label = "pavex::middleware::Next::new(crate::route_1::Next2<'a>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_1::Next2(&'a app_e628417e::Spy) -> crate::route_1::Next2<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] + 5 -> 0 [ ] + 5 -> 3 [ ] +} + +digraph "GET /nested - 4" { + 0 [ label = "app_e628417e::second_pre(&app_e628417e::Spy) -> pavex::middleware::Processing"] + 2 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] +} + +digraph "GET /nested - 5" { + 0 [ label = "app_e628417e::handler(&app_e628417e::Spy) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&app_e628417e::Spy"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /nested - 6" { + 0 [ label = "app_e628417e::second_post(&app_e628417e::Spy, pavex::response::Response) -> pavex::response::Response"] + 2 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "GET /nested - 7" { + 0 [ label = "app_e628417e::first_post(&app_e628417e::Spy, pavex::response::Response) -> pavex::response::Response"] + 2 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "* /nested - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a pavex::router::AllowedMethods) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /nested - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /top_level - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_4::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_4::Next0(&'a app_e628417e::Spy) -> crate::route_4::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_e628417e::Spy"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET /top_level - 1" { + 0 [ label = "app_e628417e::first(&app_e628417e::Spy, pavex::middleware::Next>) -> pavex::response::Response"] + 2 [ label = "pavex::middleware::Next::new(crate::route_4::Next1<'a>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_4::Next1(&'a app_e628417e::Spy) -> crate::route_4::Next1<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] + 5 -> 0 [ ] + 5 -> 3 [ ] +} + +digraph "GET /top_level - 2" { + 0 [ label = "app_e628417e::second(&app_e628417e::Spy, pavex::middleware::Next>) -> pavex::response::Response"] + 2 [ label = "pavex::middleware::Next::new(crate::route_4::Next2<'a>) -> pavex::middleware::Next>"] + 3 [ label = "crate::route_4::Next2(&'a app_e628417e::Spy) -> crate::route_4::Next2<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] + 5 -> 0 [ ] + 5 -> 3 [ ] +} + +digraph "GET /top_level - 3" { + 0 [ label = "app_e628417e::first_pre(&app_e628417e::Spy) -> pavex::middleware::Processing"] + 2 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] +} + +digraph "GET /top_level - 4" { + 0 [ label = "app_e628417e::second_pre(&app_e628417e::Spy) -> pavex::middleware::Processing"] + 2 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] +} + +digraph "GET /top_level - 5" { + 0 [ label = "app_e628417e::handler(&app_e628417e::Spy) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&app_e628417e::Spy"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /top_level - 6" { + 0 [ label = "app_e628417e::first_post(&app_e628417e::Spy, pavex::response::Response) -> pavex::response::Response"] + 2 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "GET /top_level - 7" { + 0 [ label = "app_e628417e::second_post(&app_e628417e::Spy, pavex::response::Response) -> pavex::response::Response"] + 2 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&app_e628417e::Spy"] + 2 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "* /top_level - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a pavex::router::AllowedMethods) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /top_level - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_e628417e::Spy) -> crate::ApplicationState"] + 1 [ label = "app_e628417e::Spy"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/expectations/app.rs b/libs/ui_tests/middlewares/middlewares_execution_order/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/expectations/app.rs rename to libs/ui_tests/middlewares/middlewares_execution_order/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/expectations/diagnostics.dot b/libs/ui_tests/middlewares/middlewares_execution_order/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/expectations/diagnostics.dot rename to libs/ui_tests/middlewares/middlewares_execution_order/expectations/diagnostics.dot diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml new file mode 100644 index 000000000..1812c9259 --- /dev/null +++ b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_e628417e" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_e628417e = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/blueprint.ron b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/blueprint.ron new file mode 100644 index 000000000..4c6d4dfb4 --- /dev/null +++ b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/blueprint.ron @@ -0,0 +1,654 @@ +( + creation_location: ( + line: 30, + column: 18, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + components: [ + PrebuiltType(( + input: ( + type_: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "self::Spy", + ), + location: ( + line: 31, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + cloning_strategy: None, + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 40, + column: 18, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + components: [ + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::first", + ), + location: ( + line: 41, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second", + ), + location: ( + line: 42, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::first_post", + ), + location: ( + line: 43, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second_post", + ), + location: ( + line: 44, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::first_pre", + ), + location: ( + line: 45, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second_pre", + ), + location: ( + line: 46, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/top_level", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::handler", + ), + location: ( + line: 47, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 32, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 52, + column: 18, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + components: [ + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::first", + ), + location: ( + line: 53, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::first_post", + ), + location: ( + line: 54, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::first_pre", + ), + location: ( + line: 55, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/after_handler", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::handler", + ), + location: ( + line: 56, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second", + ), + location: ( + line: 57, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second_pre", + ), + location: ( + line: 58, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second_post", + ), + location: ( + line: 59, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 33, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 64, + column: 18, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + components: [ + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::first", + ), + location: ( + line: 65, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::first_post", + ), + location: ( + line: 66, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::early_return_pre", + ), + location: ( + line: 67, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second", + ), + location: ( + line: 68, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second_pre", + ), + location: ( + line: 69, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second_post", + ), + location: ( + line: 70, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/early_return", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::handler", + ), + location: ( + line: 71, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 34, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 76, + column: 18, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + components: [ + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::first", + ), + location: ( + line: 77, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::first_pre", + ), + location: ( + line: 78, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::first_post", + ), + location: ( + line: 79, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + NestedBlueprint(( + blueprint: ( + creation_location: ( + line: 81, + column: 22, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + components: [ + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second", + ), + location: ( + line: 82, + column: 12, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second_post", + ), + location: ( + line: 83, + column: 12, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::second_pre", + ), + location: ( + line: 84, + column: 12, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/nested", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::handler", + ), + location: ( + line: 85, + column: 12, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 80, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::third", + ), + location: ( + line: 88, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::third_pre", + ), + location: ( + line: 89, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_e628417e", + module_path: "app_e628417e", + ), + import_path: "crate::third_post", + ), + location: ( + line: 90, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + ), + error_handler: None, + )), + ], + ), + path_prefix: None, + nesting_location: ( + line: 35, + column: 8, + file: "middlewares/middlewares_execution_order/src/lib.rs", + ), + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/src/lib.rs b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/src/lib.rs new file mode 100644 index 000000000..518196723 --- /dev/null +++ b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/src/lib.rs @@ -0,0 +1,652 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_e628417e::Spy, +} +pub async fn build_application_state(v0: app_e628417e::Spy) -> crate::ApplicationState { + crate::ApplicationState { s0: v0 } +} +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("/after_handler", 0u32).unwrap(); + router.insert("/early_return", 1u32).unwrap(); + router.insert("/nested", 2u32).unwrap(); + router.insert("/top_level", 3u32).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_0::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::GET => { + route_3::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_0::entrypoint(&allowed_methods).await + } + } + } + 1u32 => { + match &request_head.method { + &pavex::http::Method::GET => { + route_2::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_0::entrypoint(&allowed_methods).await + } + } + } + 2u32 => { + match &request_head.method { + &pavex::http::Method::GET => { + route_1::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_0::entrypoint(&allowed_methods).await + } + } + } + 3u32 => { + match &request_head.method { + &pavex::http::Method::GET => { + route_4::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_0::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + 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_0::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) + } + } +} +pub mod route_1 { + pub async fn entrypoint<'a>( + s_0: &'a app_e628417e::Spy, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { + let response = wrapping_1(s_0).await; + response + } + async fn stage_2<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { + if let Some(response) = pre_processing_0(s_0).await.into_response() { + return response; + } + let response = wrapping_2(s_0).await; + let response = post_processing_1(response, s_0).await; + response + } + async fn stage_3<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { + if let Some(response) = pre_processing_1(s_0).await.into_response() { + return response; + } + let response = handler(s_0).await; + let response = post_processing_0(response, s_0).await; + response + } + async fn wrapping_0(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = crate::route_1::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 wrapping_1(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = crate::route_1::Next1 { + s_0: v0, + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_e628417e::first(v0, v2).await; + ::into_response(v3) + } + async fn pre_processing_0( + v0: &app_e628417e::Spy, + ) -> pavex::middleware::Processing { + app_e628417e::first_pre(v0).await + } + async fn wrapping_2(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = crate::route_1::Next2 { + s_0: v0, + next: stage_3, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_e628417e::second(v0, v2).await; + ::into_response(v3) + } + async fn pre_processing_1( + v0: &app_e628417e::Spy, + ) -> pavex::middleware::Processing { + app_e628417e::second_pre(v0).await + } + async fn handler(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = app_e628417e::handler(v0).await; + ::into_response(v1) + } + async fn post_processing_0( + v0: pavex::response::Response, + v1: &app_e628417e::Spy, + ) -> pavex::response::Response { + let v2 = app_e628417e::second_post(v1, v0).await; + ::into_response(v2) + } + async fn post_processing_1( + v0: pavex::response::Response, + v1: &app_e628417e::Spy, + ) -> pavex::response::Response { + let v2 = app_e628417e::first_post(v1, v0).await; + ::into_response(v2) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_e628417e::Spy, + next: fn(&'a app_e628417e::Spy) -> 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) + } + } + struct Next1<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_e628417e::Spy, + next: fn(&'a app_e628417e::Spy) -> T, + } + impl<'a, T> std::future::IntoFuture for Next1<'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) + } + } + struct Next2<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_e628417e::Spy, + next: fn(&'a app_e628417e::Spy) -> T, + } + impl<'a, T> std::future::IntoFuture for Next2<'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) + } + } +} +pub mod route_2 { + pub async fn entrypoint<'a>( + s_0: &'a app_e628417e::Spy, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { + let response = wrapping_1(s_0).await; + response + } + async fn stage_2<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { + if let Some(response) = pre_processing_0(s_0).await.into_response() { + return response; + } + let response = wrapping_2(s_0).await; + let response = post_processing_1(response, s_0).await; + response + } + async fn stage_3<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { + if let Some(response) = pre_processing_1(s_0).await.into_response() { + return response; + } + let response = handler(s_0).await; + let response = post_processing_0(response, s_0).await; + response + } + async fn wrapping_0(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = crate::route_2::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 wrapping_1(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = crate::route_2::Next1 { + s_0: v0, + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_e628417e::first(v0, v2).await; + ::into_response(v3) + } + async fn pre_processing_0( + v0: &app_e628417e::Spy, + ) -> pavex::middleware::Processing { + app_e628417e::early_return_pre(v0).await + } + async fn wrapping_2(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = crate::route_2::Next2 { + s_0: v0, + next: stage_3, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_e628417e::second(v0, v2).await; + ::into_response(v3) + } + async fn pre_processing_1( + v0: &app_e628417e::Spy, + ) -> pavex::middleware::Processing { + app_e628417e::second_pre(v0).await + } + async fn handler(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = app_e628417e::handler(v0).await; + ::into_response(v1) + } + async fn post_processing_0( + v0: pavex::response::Response, + v1: &app_e628417e::Spy, + ) -> pavex::response::Response { + let v2 = app_e628417e::second_post(v1, v0).await; + ::into_response(v2) + } + async fn post_processing_1( + v0: pavex::response::Response, + v1: &app_e628417e::Spy, + ) -> pavex::response::Response { + let v2 = app_e628417e::first_post(v1, v0).await; + ::into_response(v2) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_e628417e::Spy, + next: fn(&'a app_e628417e::Spy) -> 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) + } + } + struct Next1<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_e628417e::Spy, + next: fn(&'a app_e628417e::Spy) -> T, + } + impl<'a, T> std::future::IntoFuture for Next1<'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) + } + } + struct Next2<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_e628417e::Spy, + next: fn(&'a app_e628417e::Spy) -> T, + } + impl<'a, T> std::future::IntoFuture for Next2<'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) + } + } +} +pub mod route_3 { + pub async fn entrypoint<'a>( + s_0: &'a app_e628417e::Spy, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { + let response = wrapping_1(s_0).await; + response + } + async fn stage_2<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { + if let Some(response) = pre_processing_0(s_0).await.into_response() { + return response; + } + let response = handler(s_0).await; + let response = post_processing_0(response, s_0).await; + response + } + async fn wrapping_0(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = crate::route_3::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 wrapping_1(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = crate::route_3::Next1 { + s_0: v0, + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_e628417e::first(v0, v2).await; + ::into_response(v3) + } + async fn pre_processing_0( + v0: &app_e628417e::Spy, + ) -> pavex::middleware::Processing { + app_e628417e::first_pre(v0).await + } + async fn handler(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = app_e628417e::handler(v0).await; + ::into_response(v1) + } + async fn post_processing_0( + v0: pavex::response::Response, + v1: &app_e628417e::Spy, + ) -> pavex::response::Response { + let v2 = app_e628417e::first_post(v1, v0).await; + ::into_response(v2) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_e628417e::Spy, + next: fn(&'a app_e628417e::Spy) -> 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) + } + } + struct Next1<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_e628417e::Spy, + next: fn(&'a app_e628417e::Spy) -> T, + } + impl<'a, T> std::future::IntoFuture for Next1<'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) + } + } +} +pub mod route_4 { + pub async fn entrypoint<'a>( + s_0: &'a app_e628417e::Spy, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { + let response = wrapping_1(s_0).await; + response + } + async fn stage_2<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { + let response = wrapping_2(s_0).await; + response + } + async fn stage_3<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { + if let Some(response) = pre_processing_0(s_0).await.into_response() { + return response; + } + if let Some(response) = pre_processing_1(s_0).await.into_response() { + return response; + } + let response = handler(s_0).await; + let response = post_processing_0(response, s_0).await; + let response = post_processing_1(response, s_0).await; + response + } + async fn wrapping_0(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = crate::route_4::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 wrapping_1(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = crate::route_4::Next1 { + s_0: v0, + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_e628417e::first(v0, v2).await; + ::into_response(v3) + } + async fn wrapping_2(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = crate::route_4::Next2 { + s_0: v0, + next: stage_3, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_e628417e::second(v0, v2).await; + ::into_response(v3) + } + async fn pre_processing_0( + v0: &app_e628417e::Spy, + ) -> pavex::middleware::Processing { + app_e628417e::first_pre(v0).await + } + async fn pre_processing_1( + v0: &app_e628417e::Spy, + ) -> pavex::middleware::Processing { + app_e628417e::second_pre(v0).await + } + async fn handler(v0: &app_e628417e::Spy) -> pavex::response::Response { + let v1 = app_e628417e::handler(v0).await; + ::into_response(v1) + } + async fn post_processing_0( + v0: pavex::response::Response, + v1: &app_e628417e::Spy, + ) -> pavex::response::Response { + let v2 = app_e628417e::first_post(v1, v0).await; + ::into_response(v2) + } + async fn post_processing_1( + v0: pavex::response::Response, + v1: &app_e628417e::Spy, + ) -> pavex::response::Response { + let v2 = app_e628417e::second_post(v1, v0).await; + ::into_response(v2) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_e628417e::Spy, + next: fn(&'a app_e628417e::Spy) -> 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) + } + } + struct Next1<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_e628417e::Spy, + next: fn(&'a app_e628417e::Spy) -> T, + } + impl<'a, T> std::future::IntoFuture for Next1<'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) + } + } + struct Next2<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_e628417e::Spy, + next: fn(&'a app_e628417e::Spy) -> T, + } + impl<'a, T> std::future::IntoFuture for Next2<'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) + } + } +} diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/integration/Cargo.toml b/libs/ui_tests/middlewares/middlewares_execution_order/integration/Cargo.toml new file mode 100644 index 000000000..22696f3bf --- /dev/null +++ b/libs/ui_tests/middlewares/middlewares_execution_order/integration/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "integration_e628417e" +version = "0.1.0" +edition = "2021" + +[dependencies.application] +path = "../generated_app" +package = "application_e628417e" + +[dependencies.app] +path = ".." +package = "app_e628417e" + +[dev-dependencies.tokio] +workspace = true +features = ["full"] + +[dev-dependencies.reqwest] +workspace = true + +[dev-dependencies.pavex] +workspace = true + +[dev-dependencies.tracing-subscriber] +version = "0.3" +features = ["env-filter", "fmt"] diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/integration/src/lib.rs b/libs/ui_tests/middlewares/middlewares_execution_order/integration/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/test.rs b/libs/ui_tests/middlewares/middlewares_execution_order/integration/tests/run.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/test.rs rename to libs/ui_tests/middlewares/middlewares_execution_order/integration/tests/run.rs diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/lib.rs b/libs/ui_tests/middlewares/middlewares_execution_order/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/lib.rs rename to libs/ui_tests/middlewares/middlewares_execution_order/src/lib.rs diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/src/main.rs b/libs/ui_tests/middlewares/middlewares_execution_order/src/main.rs new file mode 100644 index 000000000..8ea49c0a4 --- /dev/null +++ b/libs/ui_tests/middlewares/middlewares_execution_order/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_e628417e::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/test_config.toml b/libs/ui_tests/middlewares/middlewares_execution_order/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/middlewares_execution_order/test_config.toml rename to libs/ui_tests/middlewares/middlewares_execution_order/test_config.toml diff --git a/libs/ui_tests/middlewares/next_handles_lifetimes/Cargo.toml b/libs/ui_tests/middlewares/next_handles_lifetimes/Cargo.toml new file mode 100644 index 000000000..bae25e97b --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_lifetimes/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_dc1710a5" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/middlewares/next_handles_lifetimes/diagnostics.dot b/libs/ui_tests/middlewares/next_handles_lifetimes/diagnostics.dot new file mode 100644 index 000000000..6fee3854d --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_lifetimes/diagnostics.dot @@ -0,0 +1,79 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_dc1710a5::mw(pavex::middleware::Next>, app_dc1710a5::B<'l>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next1<'a, 'b>) -> pavex::middleware::Next>"] + 2 [ label = "app_dc1710a5::b(&''a app_dc1710a5::A, &''a app_dc1710a5::C) -> app_dc1710a5::B<'a>"] + 3 [ label = "app_dc1710a5::a() -> app_dc1710a5::A"] + 4 [ label = "app_dc1710a5::c() -> app_dc1710a5::C"] + 5 [ label = "crate::route_0::Next1(&'a app_dc1710a5::C, &'b app_dc1710a5::A) -> crate::route_0::Next1<'a, 'b>"] + 6 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 2 -> 0 [ ] + 4 -> 2 [ label = "&"] + 3 -> 2 [ label = "&"] + 1 -> 0 [ ] + 5 -> 1 [ ] + 3 -> 5 [ label = "&"] + 4 -> 5 [ label = "&"] + 0 -> 6 [ ] +} + +digraph "GET /home - 2" { + 0 [ label = "app_dc1710a5::handler(&app_dc1710a5::A, &app_dc1710a5::C) -> pavex::response::Response"] + 1 [ label = "&app_dc1710a5::C"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&app_dc1710a5::A"] + 1 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "app_dc1710a5::mw(pavex::middleware::Next>, app_dc1710a5::B<'l>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next1<'a>) -> pavex::middleware::Next>"] + 2 [ label = "app_dc1710a5::b(&''a app_dc1710a5::A, &''a app_dc1710a5::C) -> app_dc1710a5::B<'a>"] + 3 [ label = "app_dc1710a5::a() -> app_dc1710a5::A"] + 4 [ label = "app_dc1710a5::c() -> app_dc1710a5::C"] + 5 [ label = "crate::route_1::Next1(&'a pavex::router::AllowedMethods) -> crate::route_1::Next1<'a>"] + 7 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 8 [ label = "&pavex::router::AllowedMethods"] + 2 -> 0 [ ] + 4 -> 2 [ label = "&"] + 3 -> 2 [ label = "&"] + 1 -> 0 [ ] + 5 -> 1 [ ] + 0 -> 7 [ ] + 8 -> 5 [ ] +} + +digraph "* /home - 2" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/expectations/app.rs b/libs/ui_tests/middlewares/next_handles_lifetimes/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/expectations/app.rs rename to libs/ui_tests/middlewares/next_handles_lifetimes/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/expectations/diagnostics.dot b/libs/ui_tests/middlewares/next_handles_lifetimes/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/expectations/diagnostics.dot rename to libs/ui_tests/middlewares/next_handles_lifetimes/expectations/diagnostics.dot diff --git a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml new file mode 100644 index 000000000..4bf7b76e1 --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_dc1710a5" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_dc1710a5 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/blueprint.ron b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/blueprint.ron new file mode 100644 index 000000000..a6e4339e5 --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/blueprint.ron @@ -0,0 +1,107 @@ +( + creation_location: ( + line: 38, + column: 18, + file: "middlewares/next_handles_lifetimes/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_dc1710a5", + module_path: "app_dc1710a5", + ), + import_path: "crate::a", + ), + location: ( + line: 39, + column: 8, + file: "middlewares/next_handles_lifetimes/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_dc1710a5", + module_path: "app_dc1710a5", + ), + import_path: "crate::b", + ), + location: ( + line: 40, + column: 8, + file: "middlewares/next_handles_lifetimes/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_dc1710a5", + module_path: "app_dc1710a5", + ), + import_path: "crate::c", + ), + location: ( + line: 41, + column: 8, + file: "middlewares/next_handles_lifetimes/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_dc1710a5", + module_path: "app_dc1710a5", + ), + import_path: "crate::mw", + ), + location: ( + line: 42, + column: 8, + file: "middlewares/next_handles_lifetimes/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_dc1710a5", + module_path: "app_dc1710a5", + ), + import_path: "crate::handler", + ), + location: ( + line: 43, + column: 8, + file: "middlewares/next_handles_lifetimes/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/src/lib.rs b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/src/lib.rs new file mode 100644 index 000000000..276176a4b --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/src/lib.rs @@ -0,0 +1,230 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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 = wrapping_1().await; + response + } + async fn stage_2<'a, 'b>( + s_0: &'a app_dc1710a5::C, + s_1: &'b app_dc1710a5::A, + ) -> pavex::response::Response { + let response = handler(s_0, s_1).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 wrapping_1() -> pavex::response::Response { + let v0 = app_dc1710a5::c(); + let v1 = app_dc1710a5::a(); + let v2 = app_dc1710a5::b(&v1, &v0); + let v3 = crate::route_0::Next1 { + s_0: &v0, + s_1: &v1, + next: stage_2, + }; + let v4 = pavex::middleware::Next::new(v3); + let v5 = app_dc1710a5::mw(v4, v2); + ::into_response(v5) + } + async fn handler( + v0: &app_dc1710a5::C, + v1: &app_dc1710a5::A, + ) -> pavex::response::Response { + let v2 = app_dc1710a5::handler(v1, v0); + ::into_response(v2) + } + 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)() + } + } + struct Next1<'a, 'b, T> + where + T: std::future::Future, + { + s_0: &'a app_dc1710a5::C, + s_1: &'b app_dc1710a5::A, + next: fn(&'a app_dc1710a5::C, &'b app_dc1710a5::A) -> T, + } + impl<'a, 'b, T> std::future::IntoFuture for Next1<'a, 'b, 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, self.s_1) + } + } +} +pub mod route_1 { + 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 = wrapping_1(s_0).await; + response + } + async fn stage_2<'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_1::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 wrapping_1( + v0: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v1 = app_dc1710a5::c(); + let v2 = app_dc1710a5::a(); + let v3 = app_dc1710a5::b(&v2, &v1); + let v4 = crate::route_1::Next1 { + s_0: v0, + next: stage_2, + }; + let v5 = pavex::middleware::Next::new(v4); + let v6 = app_dc1710a5::mw(v5, v3); + ::into_response(v6) + } + 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) + } + } + struct Next1<'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 Next1<'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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/lib.rs b/libs/ui_tests/middlewares/next_handles_lifetimes/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/lib.rs rename to libs/ui_tests/middlewares/next_handles_lifetimes/src/lib.rs diff --git a/libs/ui_tests/middlewares/next_handles_lifetimes/src/main.rs b/libs/ui_tests/middlewares/next_handles_lifetimes/src/main.rs new file mode 100644 index 000000000..4e82433c9 --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_lifetimes/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_dc1710a5::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/test_config.toml b/libs/ui_tests/middlewares/next_handles_lifetimes/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/next_handles_lifetimes/test_config.toml rename to libs/ui_tests/middlewares/next_handles_lifetimes/test_config.toml diff --git a/libs/ui_tests/middlewares/next_handles_mut_references/Cargo.toml b/libs/ui_tests/middlewares/next_handles_mut_references/Cargo.toml new file mode 100644 index 000000000..0a91183fe --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_mut_references/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_db1cbdff" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/middlewares/next_handles_mut_references/diagnostics.dot b/libs/ui_tests/middlewares/next_handles_mut_references/diagnostics.dot new file mode 100644 index 000000000..4da6426a5 --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_mut_references/diagnostics.dot @@ -0,0 +1,87 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0(app_db1cbdff::A) -> crate::route_0::Next0"] + 3 [ label = "app_db1cbdff::a() -> app_db1cbdff::A"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_db1cbdff::mw(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next1<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next1(&'a mut app_db1cbdff::A) -> crate::route_0::Next1<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&mut app_db1cbdff::A"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET /home - 2" { + 0 [ label = "app_db1cbdff::handler(&mut app_db1cbdff::A) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&mut app_db1cbdff::A"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /home - 3" { + 0 [ label = "app_db1cbdff::post(app_db1cbdff::A, pavex::response::Response) -> pavex::response::Response"] + 1 [ label = "app_db1cbdff::A"] + 2 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 2 -> 0 [ ] + 1 -> 0 [ ] + 0 -> 3 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "app_db1cbdff::mw(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next1<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next1(&'a pavex::router::AllowedMethods) -> crate::route_1::Next1<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 2" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* /home - 3" { + 0 [ label = "app_db1cbdff::post(app_db1cbdff::A, pavex::response::Response) -> pavex::response::Response"] + 1 [ label = "app_db1cbdff::a() -> app_db1cbdff::A"] + 2 [ label = "pavex::response::Response"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 2 -> 0 [ ] + 1 -> 0 [ ] + 0 -> 3 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_mut_references/expectations/app.rs b/libs/ui_tests/middlewares/next_handles_mut_references/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/next_handles_mut_references/expectations/app.rs rename to libs/ui_tests/middlewares/next_handles_mut_references/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_mut_references/expectations/diagnostics.dot b/libs/ui_tests/middlewares/next_handles_mut_references/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/next_handles_mut_references/expectations/diagnostics.dot rename to libs/ui_tests/middlewares/next_handles_mut_references/expectations/diagnostics.dot diff --git a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml new file mode 100644 index 000000000..5726b199d --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_db1cbdff" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_db1cbdff = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/blueprint.ron b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/blueprint.ron new file mode 100644 index 000000000..31296c9f2 --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/blueprint.ron @@ -0,0 +1,84 @@ +( + creation_location: ( + line: 30, + column: 18, + file: "middlewares/next_handles_mut_references/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_db1cbdff", + module_path: "app_db1cbdff", + ), + import_path: "crate::a", + ), + location: ( + line: 31, + column: 8, + file: "middlewares/next_handles_mut_references/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_db1cbdff", + module_path: "app_db1cbdff", + ), + import_path: "crate::post", + ), + location: ( + line: 32, + column: 8, + file: "middlewares/next_handles_mut_references/src/lib.rs", + ), + ), + error_handler: None, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_db1cbdff", + module_path: "app_db1cbdff", + ), + import_path: "crate::mw", + ), + location: ( + line: 33, + column: 8, + file: "middlewares/next_handles_mut_references/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_db1cbdff", + module_path: "app_db1cbdff", + ), + import_path: "crate::handler", + ), + location: ( + line: 34, + column: 8, + file: "middlewares/next_handles_mut_references/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/src/lib.rs b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/src/lib.rs new file mode 100644 index 000000000..a04e9a270 --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/src/lib.rs @@ -0,0 +1,235 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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(mut s_0: app_db1cbdff::A) -> pavex::response::Response { + let response = wrapping_1(&mut s_0).await; + let response = post_processing_0(s_0, response).await; + response + } + async fn stage_2<'a>(s_0: &'a mut app_db1cbdff::A) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0() -> pavex::response::Response { + let v0 = app_db1cbdff::a(); + let v1 = crate::route_0::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 wrapping_1(v0: &mut app_db1cbdff::A) -> pavex::response::Response { + let v1 = crate::route_0::Next1 { + s_0: v0, + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_db1cbdff::mw(v2); + ::into_response(v3) + } + async fn handler(v0: &mut app_db1cbdff::A) -> pavex::response::Response { + let v1 = app_db1cbdff::handler(v0); + ::into_response(v1) + } + async fn post_processing_0( + v0: app_db1cbdff::A, + v1: pavex::response::Response, + ) -> pavex::response::Response { + let v2 = app_db1cbdff::post(v0, v1); + ::into_response(v2) + } + struct Next0 + where + T: std::future::Future, + { + s_0: app_db1cbdff::A, + next: fn(app_db1cbdff::A) -> 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)(self.s_0) + } + } + struct Next1<'a, T> + where + T: std::future::Future, + { + s_0: &'a mut app_db1cbdff::A, + next: fn(&'a mut app_db1cbdff::A) -> T, + } + impl<'a, T> std::future::IntoFuture for Next1<'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) + } + } +} +pub mod route_1 { + 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 = wrapping_1(s_0).await; + let response = post_processing_0(response).await; + response + } + async fn stage_2<'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_1::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 wrapping_1( + v0: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v1 = crate::route_1::Next1 { + s_0: v0, + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_db1cbdff::mw(v2); + ::into_response(v3) + } + async fn handler(v0: &pavex::router::AllowedMethods) -> pavex::response::Response { + let v1 = pavex::router::default_fallback(v0).await; + ::into_response(v1) + } + async fn post_processing_0( + v0: pavex::response::Response, + ) -> pavex::response::Response { + let v1 = app_db1cbdff::a(); + let v2 = app_db1cbdff::post(v1, v0); + ::into_response(v2) + } + 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) + } + } + struct Next1<'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 Next1<'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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_mut_references/lib.rs b/libs/ui_tests/middlewares/next_handles_mut_references/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/next_handles_mut_references/lib.rs rename to libs/ui_tests/middlewares/next_handles_mut_references/src/lib.rs diff --git a/libs/ui_tests/middlewares/next_handles_mut_references/src/main.rs b/libs/ui_tests/middlewares/next_handles_mut_references/src/main.rs new file mode 100644 index 000000000..3df410ead --- /dev/null +++ b/libs/ui_tests/middlewares/next_handles_mut_references/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_db1cbdff::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/next_handles_mut_references/test_config.toml b/libs/ui_tests/middlewares/next_handles_mut_references/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/next_handles_mut_references/test_config.toml rename to libs/ui_tests/middlewares/next_handles_mut_references/test_config.toml diff --git a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/Cargo.toml b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/Cargo.toml new file mode 100644 index 000000000..abf9ed3c4 --- /dev/null +++ b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_4b6f5359" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/diagnostics.dot b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/diagnostics.dot new file mode 100644 index 000000000..0ff02074a --- /dev/null +++ b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/diagnostics.dot @@ -0,0 +1,101 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0(app_4b6f5359::A) -> crate::route_0::Next0"] + 3 [ label = "app_4b6f5359::a() -> app_4b6f5359::A"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_4b6f5359::pre(&app_4b6f5359::A) -> pavex::middleware::Processing"] + 2 [ label = "&app_4b6f5359::A"] + 2 -> 0 [ ] +} + +digraph "GET /home - 2" { + 0 [ label = "app_4b6f5359::wrap(pavex::middleware::Next, &app_4b6f5359::A) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next1) -> pavex::middleware::Next"] + 3 [ label = "crate::route_0::Next1() -> crate::route_0::Next1"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_4b6f5359::A"] + 1 -> 0 [ ] + 3 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 0 [ ] +} + +digraph "GET /home - 3" { + 0 [ label = "app_4b6f5359::handler() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "GET /home - 4" { + 0 [ label = "app_4b6f5359::post(pavex::response::Response, app_4b6f5359::A) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 2 [ label = "app_4b6f5359::A"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 0 [ ] + 0 -> 3 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods, app_4b6f5359::A) -> crate::route_1::Next0<'a>"] + 4 [ label = "app_4b6f5359::a() -> app_4b6f5359::A"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 4 -> 2 [ ] + 0 -> 5 [ ] + 6 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "app_4b6f5359::pre(&app_4b6f5359::A) -> pavex::middleware::Processing"] + 2 [ label = "&app_4b6f5359::A"] + 2 -> 0 [ ] +} + +digraph "* /home - 2" { + 0 [ label = "app_4b6f5359::wrap(pavex::middleware::Next>, &app_4b6f5359::A) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next1<'a>) -> pavex::middleware::Next>"] + 2 [ label = "&pavex::router::AllowedMethods"] + 3 [ label = "crate::route_1::Next1(&'a pavex::router::AllowedMethods) -> crate::route_1::Next1<'a>"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&app_4b6f5359::A"] + 2 -> 3 [ ] + 1 -> 0 [ ] + 3 -> 1 [ ] + 0 -> 5 [ ] + 6 -> 0 [ ] +} + +digraph "* /home - 3" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* /home - 4" { + 0 [ label = "app_4b6f5359::post(pavex::response::Response, app_4b6f5359::A) -> pavex::response::Response"] + 1 [ label = "pavex::response::Response"] + 2 [ label = "app_4b6f5359::A"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 0 [ ] + 0 -> 3 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/expectations/app.rs b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/expectations/app.rs rename to libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/expectations/diagnostics.dot b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/expectations/diagnostics.dot rename to libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/expectations/diagnostics.dot diff --git a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml new file mode 100644 index 000000000..395f29e33 --- /dev/null +++ b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_4b6f5359" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_4b6f5359 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/blueprint.ron b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/blueprint.ron new file mode 100644 index 000000000..8f5f7b683 --- /dev/null +++ b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/blueprint.ron @@ -0,0 +1,101 @@ +( + creation_location: ( + line: 30, + column: 18, + file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_4b6f5359", + module_path: "app_4b6f5359", + ), + import_path: "crate::a", + ), + location: ( + line: 31, + column: 8, + file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + PreProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_4b6f5359", + module_path: "app_4b6f5359", + ), + import_path: "crate::pre", + ), + location: ( + line: 32, + column: 8, + file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", + ), + ), + error_handler: None, + )), + PostProcessingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_4b6f5359", + module_path: "app_4b6f5359", + ), + import_path: "crate::post", + ), + location: ( + line: 33, + column: 8, + file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", + ), + ), + error_handler: None, + )), + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_4b6f5359", + module_path: "app_4b6f5359", + ), + import_path: "crate::wrap", + ), + location: ( + line: 34, + column: 8, + file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_4b6f5359", + module_path: "app_4b6f5359", + ), + import_path: "crate::handler", + ), + location: ( + line: 35, + column: 8, + file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/src/lib.rs b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/src/lib.rs new file mode 100644 index 000000000..7949a62bf --- /dev/null +++ b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/src/lib.rs @@ -0,0 +1,254 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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(s_0: app_4b6f5359::A) -> pavex::response::Response { + if let Some(response) = pre_processing_0(&s_0).await.into_response() { + return response; + } + let response = wrapping_1(&s_0).await; + let response = post_processing_0(response, s_0).await; + response + } + async fn stage_2() -> pavex::response::Response { + let response = handler().await; + response + } + async fn wrapping_0() -> pavex::response::Response { + let v0 = app_4b6f5359::a(); + let v1 = crate::route_0::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 pre_processing_0( + v0: &app_4b6f5359::A, + ) -> pavex::middleware::Processing { + app_4b6f5359::pre(v0) + } + async fn wrapping_1(v0: &app_4b6f5359::A) -> pavex::response::Response { + let v1 = crate::route_0::Next1 { + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_4b6f5359::wrap(v2, v0); + ::into_response(v3) + } + async fn handler() -> pavex::response::Response { + let v0 = app_4b6f5359::handler(); + ::into_response(v0) + } + async fn post_processing_0( + v0: pavex::response::Response, + v1: app_4b6f5359::A, + ) -> pavex::response::Response { + let v2 = app_4b6f5359::post(v0, v1); + ::into_response(v2) + } + struct Next0 + where + T: std::future::Future, + { + s_0: app_4b6f5359::A, + next: fn(app_4b6f5359::A) -> 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)(self.s_0) + } + } + struct Next1 + where + T: std::future::Future, + { + next: fn() -> T, + } + impl std::future::IntoFuture for Next1 + 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<'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, + s_1: app_4b6f5359::A, + ) -> pavex::response::Response { + if let Some(response) = pre_processing_0(&s_1).await.into_response() { + return response; + } + let response = wrapping_1(s_0, &s_1).await; + let response = post_processing_0(response, s_1).await; + response + } + async fn stage_2<'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 = app_4b6f5359::a(); + let v2 = crate::route_1::Next0 { + s_0: v0, + s_1: v1, + next: stage_1, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = pavex::middleware::wrap_noop(v3).await; + ::into_response(v4) + } + async fn pre_processing_0( + v0: &app_4b6f5359::A, + ) -> pavex::middleware::Processing { + app_4b6f5359::pre(v0) + } + async fn wrapping_1( + v0: &pavex::router::AllowedMethods, + v1: &app_4b6f5359::A, + ) -> pavex::response::Response { + let v2 = crate::route_1::Next1 { + s_0: v0, + next: stage_2, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = app_4b6f5359::wrap(v3, v1); + ::into_response(v4) + } + async fn handler(v0: &pavex::router::AllowedMethods) -> pavex::response::Response { + let v1 = pavex::router::default_fallback(v0).await; + ::into_response(v1) + } + async fn post_processing_0( + v0: pavex::response::Response, + v1: app_4b6f5359::A, + ) -> pavex::response::Response { + let v2 = app_4b6f5359::post(v0, v1); + ::into_response(v2) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a pavex::router::AllowedMethods, + s_1: app_4b6f5359::A, + next: fn(&'a pavex::router::AllowedMethods, app_4b6f5359::A) -> 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, self.s_1) + } + } + struct Next1<'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 Next1<'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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/lib.rs b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/lib.rs rename to libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs diff --git a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/main.rs b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/main.rs new file mode 100644 index 000000000..da32b3fab --- /dev/null +++ b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_4b6f5359::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/test_config.toml b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/test_config.toml rename to libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/test_config.toml diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/Cargo.toml b/libs/ui_tests/path_parameters/path_parameters_happy_path/Cargo.toml new file mode 100644 index 000000000..65e6bc505 --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_happy_path/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "app_c1ac8ad4" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.serde] +version = "1.0" +features = ["derive"] diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/diagnostics.dot b/libs/ui_tests/path_parameters/path_parameters_happy_path/diagnostics.dot new file mode 100644 index 000000000..ef6f7fbc6 --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_happy_path/diagnostics.dot @@ -0,0 +1,159 @@ +digraph "GET /home/:home_id - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a, 'b>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(pavex::request::path::RawPathParams<'a, 'b>) -> crate::route_0::Next0<'a, 'b>"] + 3 [ label = "pavex::request::path::RawPathParams<'server, 'request>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /home/:home_id - 1" { + 0 [ label = "app_c1ac8ad4::get_home(pavex::request::path::PathParams) -> pavex::response::Response"] + 1 [ label = "core::prelude::rust_2015::Result, pavex::request::path::errors::ExtractPathParamsError> -> pavex::request::path::PathParams"] + 2 [ label = "pavex::request::path::PathParams::extract(pavex::request::path::RawPathParams<'server, 'request>) -> core::prelude::rust_2015::Result, pavex::request::path::errors::ExtractPathParamsError>"] + 3 [ label = "pavex::request::path::RawPathParams<'server, 'request>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "core::prelude::rust_2015::Result, pavex::request::path::errors::ExtractPathParamsError> -> pavex::request::path::errors::ExtractPathParamsError"] + 6 [ label = "pavex::request::path::errors::ExtractPathParamsError::into_response(&pavex::request::path::errors::ExtractPathParamsError) -> pavex::response::Response"] + 7 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 8 [ label = "`match`"] + 1 -> 0 [ ] + 8 -> 5 [ ] + 3 -> 2 [ ] + 8 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 6 [ label = "&"] + 6 -> 7 [ ] + 2 -> 8 [ ] +} + +digraph "* /home/:home_id - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_3::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_3::Next0(&'a pavex::router::AllowedMethods) -> crate::route_3::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home/:home_id - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /home/:home_id/room/:room_id - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a, 'b>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(pavex::request::path::RawPathParams<'a, 'b>) -> crate::route_1::Next0<'a, 'b>"] + 3 [ label = "pavex::request::path::RawPathParams<'server, 'request>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /home/:home_id/room/:room_id - 1" { + 0 [ label = "app_c1ac8ad4::get_room(pavex::request::path::PathParams) -> pavex::response::Response"] + 1 [ label = "core::prelude::rust_2015::Result, pavex::request::path::errors::ExtractPathParamsError> -> pavex::request::path::PathParams"] + 2 [ label = "pavex::request::path::PathParams::extract(pavex::request::path::RawPathParams<'server, 'request>) -> core::prelude::rust_2015::Result, pavex::request::path::errors::ExtractPathParamsError>"] + 3 [ label = "pavex::request::path::RawPathParams<'server, 'request>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "core::prelude::rust_2015::Result, pavex::request::path::errors::ExtractPathParamsError> -> pavex::request::path::errors::ExtractPathParamsError"] + 6 [ label = "pavex::request::path::errors::ExtractPathParamsError::into_response(&pavex::request::path::errors::ExtractPathParamsError) -> pavex::response::Response"] + 7 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 8 [ label = "`match`"] + 1 -> 0 [ ] + 8 -> 5 [ ] + 3 -> 2 [ ] + 8 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 6 [ label = "&"] + 6 -> 7 [ ] + 2 -> 8 [ ] +} + +digraph "* /home/:home_id/room/:room_id - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_3::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_3::Next0(&'a pavex::router::AllowedMethods) -> crate::route_3::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home/:home_id/room/:room_id - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /town/*town - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_2::Next0<'a, 'b>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_2::Next0(pavex::request::path::RawPathParams<'a, 'b>) -> crate::route_2::Next0<'a, 'b>"] + 3 [ label = "pavex::request::path::RawPathParams<'server, 'request>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /town/*town - 1" { + 0 [ label = "app_c1ac8ad4::get_town(pavex::request::path::PathParams>) -> pavex::response::Response"] + 1 [ label = "core::prelude::rust_2015::Result>, pavex::request::path::errors::ExtractPathParamsError> -> pavex::request::path::PathParams>"] + 2 [ label = "pavex::request::path::PathParams::extract(pavex::request::path::RawPathParams<'server, 'request>) -> core::prelude::rust_2015::Result>, pavex::request::path::errors::ExtractPathParamsError>"] + 3 [ label = "pavex::request::path::RawPathParams<'server, 'request>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "core::prelude::rust_2015::Result>, pavex::request::path::errors::ExtractPathParamsError> -> pavex::request::path::errors::ExtractPathParamsError"] + 6 [ label = "pavex::request::path::errors::ExtractPathParamsError::into_response(&pavex::request::path::errors::ExtractPathParamsError) -> pavex::response::Response"] + 7 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 8 [ label = "`match`"] + 1 -> 0 [ ] + 8 -> 5 [ ] + 3 -> 2 [ ] + 8 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 6 [ label = "&"] + 6 -> 7 [ ] + 2 -> 8 [ ] +} + +digraph "* /town/*town - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_3::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_3::Next0(&'a pavex::router::AllowedMethods) -> crate::route_3::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /town/*town - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path/expectations/app.rs b/libs/ui_tests/path_parameters/path_parameters_happy_path/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path/expectations/app.rs rename to libs/ui_tests/path_parameters/path_parameters_happy_path/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path/expectations/diagnostics.dot b/libs/ui_tests/path_parameters/path_parameters_happy_path/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path/expectations/diagnostics.dot rename to libs/ui_tests/path_parameters/path_parameters_happy_path/expectations/diagnostics.dot diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml new file mode 100644 index 000000000..749c44e48 --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_c1ac8ad4" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_c1ac8ad4 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/blueprint.ron b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/blueprint.ron new file mode 100644 index 000000000..78123842c --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/blueprint.ron @@ -0,0 +1,105 @@ +( + creation_location: ( + line: 35, + column: 18, + file: "path_parameters/path_parameters_happy_path/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c1ac8ad4", + module_path: "app_c1ac8ad4", + ), + import_path: "pavex::request::path::PathParams::extract", + ), + location: ( + line: 36, + column: 8, + file: "path_parameters/path_parameters_happy_path/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_c1ac8ad4", + module_path: "app_c1ac8ad4", + ), + import_path: "pavex::request::path::errors::ExtractPathParamsError::into_response", + ), + location: ( + line: 40, + column: 6, + file: "path_parameters/path_parameters_happy_path/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/home/:home_id", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c1ac8ad4", + module_path: "app_c1ac8ad4", + ), + import_path: "crate::get_home", + ), + location: ( + line: 43, + column: 8, + file: "path_parameters/path_parameters_happy_path/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/home/:home_id/room/:room_id", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c1ac8ad4", + module_path: "app_c1ac8ad4", + ), + import_path: "crate::get_room", + ), + location: ( + line: 44, + column: 8, + file: "path_parameters/path_parameters_happy_path/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/town/*town", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c1ac8ad4", + module_path: "app_c1ac8ad4", + ), + import_path: "crate::get_town", + ), + location: ( + line: 45, + column: 8, + file: "path_parameters/path_parameters_happy_path/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/src/lib.rs b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/src/lib.rs new file mode 100644 index 000000000..a1f29db4f --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/src/lib.rs @@ -0,0 +1,326 @@ +//! 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("/home/:home_id", 0u32).unwrap(); + router.insert("/home/:home_id/room/:room_id", 1u32).unwrap(); + router.insert("/town/*town", 2u32).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_3::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::GET => route_0::entrypoint(url_params).await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_3::entrypoint(&allowed_methods).await + } + } + } + 1u32 => { + match &request_head.method { + &pavex::http::Method::GET => route_1::entrypoint(url_params).await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_3::entrypoint(&allowed_methods).await + } + } + } + 2u32 => { + match &request_head.method { + &pavex::http::Method::GET => route_2::entrypoint(url_params).await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_3::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a, 'b>( + s_0: pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a, 'b>( + s_0: pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: pavex::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = crate::route_0::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::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = pavex::request::path::PathParams::extract(v0); + let v2 = match v1 { + Ok(ok) => ok, + Err(v2) => { + return { + let v3 = pavex::request::path::errors::ExtractPathParamsError::into_response( + &v2, + ); + ::into_response( + v3, + ) + }; + } + }; + let v3 = app_c1ac8ad4::get_home(v2); + ::into_response(v3) + } + struct Next0<'a, 'b, T> + where + T: std::future::Future, + { + s_0: pavex::request::path::RawPathParams<'a, 'b>, + next: fn(pavex::request::path::RawPathParams<'a, 'b>) -> T, + } + impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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) + } + } +} +pub mod route_1 { + pub async fn entrypoint<'a, 'b>( + s_0: pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a, 'b>( + s_0: pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: pavex::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = crate::route_1::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::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = pavex::request::path::PathParams::extract(v0); + let v2 = match v1 { + Ok(ok) => ok, + Err(v2) => { + return { + let v3 = pavex::request::path::errors::ExtractPathParamsError::into_response( + &v2, + ); + ::into_response( + v3, + ) + }; + } + }; + let v3 = app_c1ac8ad4::get_room(v2); + ::into_response(v3) + } + struct Next0<'a, 'b, T> + where + T: std::future::Future, + { + s_0: pavex::request::path::RawPathParams<'a, 'b>, + next: fn(pavex::request::path::RawPathParams<'a, 'b>) -> T, + } + impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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) + } + } +} +pub mod route_2 { + pub async fn entrypoint<'a, 'b>( + s_0: pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a, 'b>( + s_0: pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: pavex::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = crate::route_2::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::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = pavex::request::path::PathParams::extract(v0); + let v2 = match v1 { + Ok(ok) => ok, + Err(v2) => { + return { + let v3 = pavex::request::path::errors::ExtractPathParamsError::into_response( + &v2, + ); + ::into_response( + v3, + ) + }; + } + }; + let v3 = app_c1ac8ad4::get_town(v2); + ::into_response(v3) + } + struct Next0<'a, 'b, T> + where + T: std::future::Future, + { + s_0: pavex::request::path::RawPathParams<'a, 'b>, + next: fn(pavex::request::path::RawPathParams<'a, 'b>) -> T, + } + impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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) + } + } +} +pub mod route_3 { + 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_3::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) + } + } +} diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/integration/Cargo.toml b/libs/ui_tests/path_parameters/path_parameters_happy_path/integration/Cargo.toml new file mode 100644 index 000000000..c4f5949f4 --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_happy_path/integration/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "integration_c1ac8ad4" +version = "0.1.0" +edition = "2021" + +[dependencies.application] +path = "../generated_app" +package = "application_c1ac8ad4" + +[dependencies.app] +path = ".." +package = "app_c1ac8ad4" + +[dev-dependencies.tokio] +workspace = true +features = ["full"] + +[dev-dependencies.reqwest] +workspace = true + +[dev-dependencies.pavex] +workspace = true + +[dev-dependencies.tracing-subscriber] +version = "0.3" +features = ["env-filter", "fmt"] diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/integration/src/lib.rs b/libs/ui_tests/path_parameters/path_parameters_happy_path/integration/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path/test.rs b/libs/ui_tests/path_parameters/path_parameters_happy_path/integration/tests/run.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path/test.rs rename to libs/ui_tests/path_parameters/path_parameters_happy_path/integration/tests/run.rs diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path/lib.rs b/libs/ui_tests/path_parameters/path_parameters_happy_path/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path/lib.rs rename to libs/ui_tests/path_parameters/path_parameters_happy_path/src/lib.rs diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/src/main.rs b/libs/ui_tests/path_parameters/path_parameters_happy_path/src/main.rs new file mode 100644 index 000000000..2ede1b54b --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_happy_path/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_c1ac8ad4::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path/test_config.toml b/libs/ui_tests/path_parameters/path_parameters_happy_path/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_happy_path/test_config.toml rename to libs/ui_tests/path_parameters/path_parameters_happy_path/test_config.toml diff --git a/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/Cargo.toml b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/Cargo.toml new file mode 100644 index 000000000..cafacc60c --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "app_c51a0844" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.serde] +version = "1.0" +features = ["derive"] diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_non_existing_fields/expectations/stderr.txt b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_non_existing_fields/expectations/stderr.txt rename to libs/ui_tests/path_parameters/path_parameters_non_existing_fields/expectations/stderr.txt diff --git a/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/Cargo.toml b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/Cargo.toml new file mode 100644 index 000000000..be8612b90 --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_c51a0844" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/blueprint.ron b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/blueprint.ron new file mode 100644 index 000000000..66b42de16 --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/blueprint.ron @@ -0,0 +1,105 @@ +( + creation_location: ( + line: 37, + column: 18, + file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_c51a0844", + module_path: "app_c51a0844", + ), + import_path: "pavex::request::path::PathParams::extract", + ), + location: ( + line: 38, + column: 8, + file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_c51a0844", + module_path: "app_c51a0844", + ), + import_path: "pavex::request::path::errors::ExtractPathParamsError::into_response", + ), + location: ( + line: 42, + column: 6, + file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/a/:x", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c51a0844", + module_path: "app_c51a0844", + ), + import_path: "crate::missing_one", + ), + location: ( + line: 45, + column: 8, + file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/b/:x", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c51a0844", + module_path: "app_c51a0844", + ), + import_path: "crate::missing_two", + ), + location: ( + line: 46, + column: 8, + file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/c", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_c51a0844", + module_path: "app_c51a0844", + ), + import_path: "crate::no_path_params", + ), + location: ( + line: 47, + column: 8, + file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/src/lib.rs b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_non_existing_fields/lib.rs b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_non_existing_fields/lib.rs rename to libs/ui_tests/path_parameters/path_parameters_non_existing_fields/src/lib.rs diff --git a/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/src/main.rs b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/src/main.rs new file mode 100644 index 000000000..e3481be6a --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_c51a0844::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_non_existing_fields/test_config.toml b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_non_existing_fields/test_config.toml rename to libs/ui_tests/path_parameters/path_parameters_non_existing_fields/test_config.toml diff --git a/libs/ui_tests/path_parameters/path_parameters_unsupported_types/Cargo.toml b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/Cargo.toml new file mode 100644 index 000000000..cba4e15ff --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "app_53b2f5d8" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.serde] +version = "1.0" +features = ["derive"] diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_unsupported_types/expectations/stderr.txt b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_unsupported_types/expectations/stderr.txt rename to libs/ui_tests/path_parameters/path_parameters_unsupported_types/expectations/stderr.txt diff --git a/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/Cargo.toml b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/Cargo.toml new file mode 100644 index 000000000..f9d58d581 --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_53b2f5d8" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/blueprint.ron b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/blueprint.ron new file mode 100644 index 000000000..ec7c242d7 --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/blueprint.ron @@ -0,0 +1,189 @@ +( + creation_location: ( + line: 54, + column: 18, + file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_53b2f5d8", + module_path: "app_53b2f5d8", + ), + import_path: "pavex::request::path::PathParams::extract", + ), + location: ( + line: 55, + column: 8, + file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_53b2f5d8", + module_path: "app_53b2f5d8", + ), + import_path: "pavex::request::path::errors::ExtractPathParamsError::into_response", + ), + location: ( + line: 59, + column: 6, + file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/a/:x", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_53b2f5d8", + module_path: "app_53b2f5d8", + ), + import_path: "crate::primitive", + ), + location: ( + line: 62, + column: 8, + file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/b/:x/:y", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_53b2f5d8", + module_path: "app_53b2f5d8", + ), + import_path: "crate::tuple", + ), + location: ( + line: 63, + column: 8, + file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/c/:x/:z", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_53b2f5d8", + module_path: "app_53b2f5d8", + ), + import_path: "crate::slice_ref", + ), + location: ( + line: 64, + column: 8, + file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/d/:x/:y", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_53b2f5d8", + module_path: "app_53b2f5d8", + ), + import_path: "crate::reference::", + ), + location: ( + line: 65, + column: 8, + file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/e/:x/:y", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_53b2f5d8", + module_path: "app_53b2f5d8", + ), + import_path: "crate::enum_", + ), + location: ( + line: 66, + column: 8, + file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/f/:x/:y", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_53b2f5d8", + module_path: "app_53b2f5d8", + ), + import_path: "crate::tuple_struct", + ), + location: ( + line: 67, + column: 8, + file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/g/:x/:y", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_53b2f5d8", + module_path: "app_53b2f5d8", + ), + import_path: "crate::unit_struct", + ), + location: ( + line: 68, + column: 8, + file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/src/lib.rs b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_unsupported_types/lib.rs b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_unsupported_types/lib.rs rename to libs/ui_tests/path_parameters/path_parameters_unsupported_types/src/lib.rs diff --git a/libs/ui_tests/path_parameters/path_parameters_unsupported_types/src/main.rs b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/src/main.rs new file mode 100644 index 000000000..9c43ca613 --- /dev/null +++ b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_53b2f5d8::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_unsupported_types/test_config.toml b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/path_parameters/path_parameters_unsupported_types/test_config.toml rename to libs/ui_tests/path_parameters/path_parameters_unsupported_types/test_config.toml diff --git a/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/Cargo.toml b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/Cargo.toml new file mode 100644 index 000000000..de9544278 --- /dev/null +++ b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_700defb2" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/expectations/stderr.txt b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/expectations/stderr.txt rename to libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/Cargo.toml b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/Cargo.toml new file mode 100644 index 000000000..35582909f --- /dev/null +++ b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_700defb2" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/blueprint.ron b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/blueprint.ron new file mode 100644 index 000000000..d2303c02b --- /dev/null +++ b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/blueprint.ron @@ -0,0 +1,30 @@ +( + creation_location: ( + line: 7, + column: 18, + file: "reflection/a_fix_is_suggested_for_function_invocations/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "POST", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_700defb2", + module_path: "app_700defb2", + ), + import_path: "self::my_f()", + ), + location: ( + line: 8, + column: 8, + file: "reflection/a_fix_is_suggested_for_function_invocations/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/src/lib.rs b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/lib.rs b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/lib.rs rename to libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/src/lib.rs diff --git a/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/src/main.rs b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/src/main.rs new file mode 100644 index 000000000..929ca36bc --- /dev/null +++ b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_700defb2::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/test_config.toml b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/test_config.toml rename to libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/test_config.toml diff --git a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/Cargo.toml b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/Cargo.toml new file mode 100644 index 000000000..4bc117f93 --- /dev/null +++ b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "app_ca963e92" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.reqwest] +version = "0.11" +features = ["json"] diff --git a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/diagnostics.dot b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/diagnostics.dot new file mode 100644 index 000000000..be234b384 --- /dev/null +++ b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/diagnostics.dot @@ -0,0 +1,39 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_ca963e92::handler() -> http::StatusCode"] + 1 [ label = "::into_response(http::StatusCode) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/ambiguous_dependency_version_is_handled/expectations/app.rs b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/ambiguous_dependency_version_is_handled/expectations/app.rs rename to libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/ambiguous_dependency_version_is_handled/expectations/diagnostics.dot b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/ambiguous_dependency_version_is_handled/expectations/diagnostics.dot rename to libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml new file mode 100644 index 000000000..b1af710d3 --- /dev/null +++ b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_ca963e92" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_ca963e92 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/blueprint.ron b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/blueprint.ron new file mode 100644 index 000000000..18f9313c9 --- /dev/null +++ b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/blueprint.ron @@ -0,0 +1,30 @@ +( + creation_location: ( + line: 10, + column: 18, + file: "reflection/ambiguous_dependency_version_is_handled/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ca963e92", + module_path: "app_ca963e92", + ), + import_path: "crate::handler", + ), + location: ( + line: 11, + column: 8, + file: "reflection/ambiguous_dependency_version_is_handled/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/src/lib.rs b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/src/lib.rs new file mode 100644 index 000000000..33ce6dfb9 --- /dev/null +++ b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/src/lib.rs @@ -0,0 +1,152 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_ca963e92::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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/ambiguous_dependency_version_is_handled/lib.rs b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/ambiguous_dependency_version_is_handled/lib.rs rename to libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/src/lib.rs diff --git a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/src/main.rs b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/src/main.rs new file mode 100644 index 000000000..2c4300fed --- /dev/null +++ b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ca963e92::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/ambiguous_dependency_version_is_handled/test_config.toml b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/ambiguous_dependency_version_is_handled/test_config.toml rename to libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/test_config.toml diff --git a/libs/ui_tests/reflection/arc_singletons_are_supported/Cargo.toml b/libs/ui_tests/reflection/arc_singletons_are_supported/Cargo.toml new file mode 100644 index 000000000..b4bedeeec --- /dev/null +++ b/libs/ui_tests/reflection/arc_singletons_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_933292bd" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/arc_singletons_are_supported/diagnostics.dot b/libs/ui_tests/reflection/arc_singletons_are_supported/diagnostics.dot new file mode 100644 index 000000000..6f4508bfd --- /dev/null +++ b/libs/ui_tests/reflection/arc_singletons_are_supported/diagnostics.dot @@ -0,0 +1,45 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a alloc::sync::Arc) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&alloc::sync::Arc"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_933292bd::handler(&alloc::sync::Arc) -> http::StatusCode"] + 2 [ label = "::into_response(http::StatusCode) -> pavex::response::Response"] + 3 [ label = "&alloc::sync::Arc"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(alloc::sync::Arc) -> crate::ApplicationState"] + 1 [ label = "app_933292bd::constructor() -> alloc::sync::Arc"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/expectations/app.rs b/libs/ui_tests/reflection/arc_singletons_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/arc_singletons_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/arc_singletons_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/arc_singletons_are_supported/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..94916408b --- /dev/null +++ b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_933292bd" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_933292bd = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..b7ce6c21a --- /dev/null +++ b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 18, + column: 18, + file: "reflection/arc_singletons_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_933292bd", + module_path: "app_933292bd", + ), + import_path: "crate::constructor", + ), + location: ( + line: 19, + column: 8, + file: "reflection/arc_singletons_are_supported/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_933292bd", + module_path: "app_933292bd", + ), + import_path: "crate::handler", + ), + location: ( + line: 20, + column: 8, + file: "reflection/arc_singletons_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..52ed88bf2 --- /dev/null +++ b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/src/lib.rs @@ -0,0 +1,166 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: alloc::sync::Arc, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_933292bd::constructor(); + crate::ApplicationState { s0: v0 } +} +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("/", 0u32).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_1::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::GET => { + route_0::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>( + s_0: &'a alloc::sync::Arc, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>( + s_0: &'a alloc::sync::Arc, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: &alloc::sync::Arc, + ) -> pavex::response::Response { + let v1 = crate::route_0::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: &alloc::sync::Arc, + ) -> pavex::response::Response { + let v1 = app_933292bd::handler(v0); + ::into_response(v1) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a alloc::sync::Arc, + next: fn(&'a alloc::sync::Arc) -> 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) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/lib.rs b/libs/ui_tests/reflection/arc_singletons_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/lib.rs rename to libs/ui_tests/reflection/arc_singletons_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/arc_singletons_are_supported/src/main.rs b/libs/ui_tests/reflection/arc_singletons_are_supported/src/main.rs new file mode 100644 index 000000000..313d2fd22 --- /dev/null +++ b/libs/ui_tests/reflection/arc_singletons_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_933292bd::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/test_config.toml b/libs/ui_tests/reflection/arc_singletons_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/arc_singletons_are_supported/test_config.toml rename to libs/ui_tests/reflection/arc_singletons_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/common_response_types_are_supported/Cargo.toml b/libs/ui_tests/reflection/common_response_types_are_supported/Cargo.toml new file mode 100644 index 000000000..494fc2b8a --- /dev/null +++ b/libs/ui_tests/reflection/common_response_types_are_supported/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "app_88bca0dc" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies] +bytes = "1" +http-body = "1" +http = "1" + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/common_response_types_are_supported/diagnostics.dot b/libs/ui_tests/reflection/common_response_types_are_supported/diagnostics.dot new file mode 100644 index 000000000..892062c4b --- /dev/null +++ b/libs/ui_tests/reflection/common_response_types_are_supported/diagnostics.dot @@ -0,0 +1,147 @@ +digraph "GET /head - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_3::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_3::Next0() -> crate::route_3::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /head - 1" { + 0 [ label = "app_88bca0dc::response_head() -> pavex::response::ResponseHead"] + 1 [ label = "::into_response(pavex::response::ResponseHead) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /head - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_4::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_4::Next0(&'a pavex::router::AllowedMethods) -> crate::route_4::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /head - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /parts - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_2::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_2::Next0() -> crate::route_2::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /parts - 1" { + 0 [ label = "app_88bca0dc::parts() -> http::response::Parts"] + 1 [ label = "::into_response(http::response::Parts) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /parts - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_4::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_4::Next0(&'a pavex::router::AllowedMethods) -> crate::route_4::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /parts - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /response - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /response - 1" { + 0 [ label = "app_88bca0dc::response() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /response - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_4::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_4::Next0(&'a pavex::router::AllowedMethods) -> crate::route_4::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /response - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "GET /status_code - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_1::Next0() -> crate::route_1::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /status_code - 1" { + 0 [ label = "app_88bca0dc::status_code() -> http::StatusCode"] + 1 [ label = "::into_response(http::StatusCode) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /status_code - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_4::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_4::Next0(&'a pavex::router::AllowedMethods) -> crate::route_4::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /status_code - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/common_response_types_are_supported/expectations/app.rs b/libs/ui_tests/reflection/common_response_types_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/common_response_types_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/common_response_types_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/common_response_types_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/common_response_types_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/common_response_types_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/common_response_types_are_supported/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..1d9ff00eb --- /dev/null +++ b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_88bca0dc" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_88bca0dc = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..673465497 --- /dev/null +++ b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/blueprint.ron @@ -0,0 +1,93 @@ +( + creation_location: ( + line: 26, + column: 18, + file: "reflection/common_response_types_are_supported/src/lib.rs", + ), + components: [ + Route(( + path: "/response", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_88bca0dc", + module_path: "app_88bca0dc", + ), + import_path: "crate::response", + ), + location: ( + line: 27, + column: 8, + file: "reflection/common_response_types_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/status_code", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_88bca0dc", + module_path: "app_88bca0dc", + ), + import_path: "crate::status_code", + ), + location: ( + line: 28, + column: 8, + file: "reflection/common_response_types_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/parts", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_88bca0dc", + module_path: "app_88bca0dc", + ), + import_path: "crate::parts", + ), + location: ( + line: 29, + column: 8, + file: "reflection/common_response_types_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/head", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_88bca0dc", + module_path: "app_88bca0dc", + ), + import_path: "crate::response_head", + ), + location: ( + line: 30, + column: 8, + file: "reflection/common_response_types_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..365a823f9 --- /dev/null +++ b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/src/lib.rs @@ -0,0 +1,307 @@ +//! 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("/head", 0u32).unwrap(); + router.insert("/parts", 1u32).unwrap(); + router.insert("/response", 2u32).unwrap(); + router.insert("/status_code", 3u32).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_4::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::GET => route_3::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_4::entrypoint(&allowed_methods).await + } + } + } + 1u32 => { + 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_4::entrypoint(&allowed_methods).await + } + } + } + 2u32 => { + match &request_head.method { + &pavex::http::Method::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_4::entrypoint(&allowed_methods).await + } + } + } + 3u32 => { + match &request_head.method { + &pavex::http::Method::GET => route_1::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_4::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_88bca0dc::response(); + ::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_88bca0dc::status_code(); + ::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_88bca0dc::parts(); + ::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_88bca0dc::response_head(); + ::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<'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_4::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/common_response_types_are_supported/lib.rs b/libs/ui_tests/reflection/common_response_types_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/common_response_types_are_supported/lib.rs rename to libs/ui_tests/reflection/common_response_types_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/common_response_types_are_supported/src/main.rs b/libs/ui_tests/reflection/common_response_types_are_supported/src/main.rs new file mode 100644 index 000000000..e4e8d098e --- /dev/null +++ b/libs/ui_tests/reflection/common_response_types_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_88bca0dc::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/common_response_types_are_supported/test_config.toml b/libs/ui_tests/reflection/common_response_types_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/common_response_types_are_supported/test_config.toml rename to libs/ui_tests/reflection/common_response_types_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/Cargo.toml new file mode 100644 index 000000000..e0cd08edb --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "app_39415e2f" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.dep] +path = "ephemeral_deps/dep" +package = "dep_39415e2f" diff --git a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/diagnostics.dot b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/diagnostics.dot similarity index 91% rename from libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/diagnostics.dot rename to libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/diagnostics.dot index df1529687..a14f9ad52 100644 --- a/libs/pavex_cli/tests/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/expectations/diagnostics.dot +++ b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/diagnostics.dot @@ -9,8 +9,8 @@ digraph "GET /home - 0" { } digraph "GET /home - 1" { - 0 [ label = "app::Streamer::stream_file(dep::Logger) -> pavex::response::Response"] - 1 [ label = "dep::new_logger() -> dep::Logger"] + 0 [ label = "app_39415e2f::handler(dep_39415e2f::Logger) -> pavex::response::Response"] + 1 [ label = "dep_39415e2f::new_logger() -> dep_39415e2f::Logger"] 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] 1 -> 0 [ ] 0 -> 2 [ ] @@ -38,4 +38,4 @@ digraph "* /home - 1" { digraph app_state { 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] -} \ No newline at end of file +} diff --git a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/ephemeral_deps/dep/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/ephemeral_deps/dep/Cargo.toml new file mode 100644 index 000000000..6c9c142dc --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/ephemeral_deps/dep/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "dep_39415e2f" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[lints.rust.unused] +level = "allow" + +[dependencies.pavex] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/dep.rs b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/ephemeral_deps/dep/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/dep.rs rename to libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/ephemeral_deps/dep/src/lib.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/app.rs b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/app.rs rename to libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/diagnostics.dot b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/diagnostics.dot rename to libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/stderr.txt b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/stderr.txt rename to libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml new file mode 100644 index 000000000..876050836 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "application_39415e2f" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_39415e2f = { version = "0.1.0", path = ".." } +dep_39415e2f = { version = "0.1.0", path = "../ephemeral_deps/dep" } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/blueprint.ron b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/blueprint.ron new file mode 100644 index 000000000..158bdee28 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 10, + column: 18, + file: "reflection/crate_resolution/dependencies_can_register_local_items/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "dep_39415e2f", + module_path: "dep_39415e2f", + ), + import_path: "crate::new_logger", + ), + location: ( + line: 11, + column: 8, + file: "reflection/crate_resolution/dependencies_can_register_local_items/ephemeral_deps/dep/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_39415e2f", + module_path: "app_39415e2f", + ), + import_path: "crate::handler", + ), + location: ( + line: 12, + column: 8, + file: "reflection/crate_resolution/dependencies_can_register_local_items/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/src/lib.rs new file mode 100644 index 000000000..7e93108ac --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/src/lib.rs @@ -0,0 +1,155 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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 v1 = { + let v0 = dep_39415e2f::new_logger(); + app_39415e2f::handler(v0) + }; + ::into_response(v1) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/lib.rs b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/lib.rs rename to libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/src/lib.rs diff --git a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/src/main.rs b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/src/main.rs new file mode 100644 index 000000000..d28d2301a --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_39415e2f::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/test_config.toml b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/test_config.toml rename to libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/test_config.toml diff --git a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/Cargo.toml new file mode 100644 index 000000000..973499a0e --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "app_cb7427d1" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.http_01] +package = "http" +version = "0.1" + +[dependencies.http_02] +package = "http" +version = "0.2" + +[dependencies.hyper] +version = "0.14" +features = ["server", "http1", "http2"] diff --git a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/diagnostics.dot b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/diagnostics.dot new file mode 100644 index 000000000..bb7c0ac88 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/diagnostics.dot @@ -0,0 +1,43 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_cb7427d1::stream_file(http_0_1_21::header::HeaderName, http_0_2_12::HeaderName) -> pavex::response::Response"] + 1 [ label = "app_cb7427d1::header1() -> http_0_1_21::header::HeaderName"] + 2 [ label = "app_cb7427d1::header2() -> http_0_2_12::HeaderName"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 2 -> 0 [ ] + 1 -> 0 [ ] + 0 -> 3 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/expectations/app.rs b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..a6279044b --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "application_cb7427d1" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_cb7427d1 = { version = "0.1.0", path = ".." } +http_0_1_21 = { version = "0.1.21", package = "http" } +http_0_2_12 = { version = "0.2.12", package = "http" } +http_1_1_0 = { version = "1.1.0", package = "http" } +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..57cfbc0c4 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 20, + column: 18, + file: "reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_cb7427d1", + module_path: "app_cb7427d1", + ), + import_path: "crate::header1", + ), + location: ( + line: 21, + column: 8, + file: "reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_cb7427d1", + module_path: "app_cb7427d1", + ), + import_path: "crate::header2", + ), + location: ( + line: 22, + column: 8, + file: "reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_cb7427d1", + module_path: "app_cb7427d1", + ), + import_path: "crate::stream_file", + ), + location: ( + line: 23, + column: 8, + file: "reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..2e5040404 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/src/lib.rs @@ -0,0 +1,154 @@ +//! 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("/home", 0u32).unwrap(); + router +} +async fn route_request( + request: http_1_1_0::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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_cb7427d1::header2(); + let v1 = app_cb7427d1::header1(); + let v2 = app_cb7427d1::stream_file(v1, v0); + ::into_response(v2) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/lib.rs b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/lib.rs rename to libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/main.rs b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/main.rs new file mode 100644 index 000000000..91e8b909b --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_cb7427d1::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/test_config.toml b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/test_config.toml rename to libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/Cargo.toml new file mode 100644 index 000000000..9d4b0a03b --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "app_3e2693d0" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.dep] +path = "ephemeral_deps/dep" +package = "dep_3e2693d0" diff --git a/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/ephemeral_deps/dep/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/ephemeral_deps/dep/Cargo.toml new file mode 100644 index 000000000..f8f078d9d --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/ephemeral_deps/dep/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "dep_3e2693d0" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[lints.rust.unused] +level = "allow" + +[dependencies.pavex] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/dep.rs b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/ephemeral_deps/dep/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/dep.rs rename to libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/ephemeral_deps/dep/src/lib.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/expectations/stderr.txt b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/expectations/stderr.txt rename to libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/Cargo.toml new file mode 100644 index 000000000..e73a61adb --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_3e2693d0" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/blueprint.ron b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/blueprint.ron new file mode 100644 index 000000000..2af5f73cf --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 10, + column: 18, + file: "reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_3e2693d0", + module_path: "app_3e2693d0", + ), + import_path: "new_logger", + ), + location: ( + line: 11, + column: 8, + file: "reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_3e2693d0", + module_path: "app_3e2693d0", + ), + import_path: "crate::handler", + ), + location: ( + line: 12, + column: 8, + file: "reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/lib.rs b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/lib.rs rename to libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/lib.rs diff --git a/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/main.rs b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/main.rs new file mode 100644 index 000000000..1cda0fe41 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_3e2693d0::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/test_config.toml b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/test_config.toml rename to libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/test_config.toml diff --git a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/Cargo.toml new file mode 100644 index 000000000..8dc9fed8d --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "app_11a9a819" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies] +pavex = "1" +pavex_cli_client = "1" + +[dependencies.dep_1] +path = "ephemeral_deps/dep_1" +package = "dep" + +[dependencies.dep_2] +path = "ephemeral_deps/dep_2" +package = "dep" diff --git a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_1/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_1/Cargo.toml new file mode 100644 index 000000000..b8e369498 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_1/Cargo.toml @@ -0,0 +1,14 @@ +[workspace] +members = ["."] + +[package] +name = "dep_11a9a819" +version = "1.0.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies] +pavex = "1" diff --git a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_1/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_1/src/lib.rs new file mode 100644 index 000000000..88cdd832c --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_1/src/lib.rs @@ -0,0 +1,12 @@ +use pavex::blueprint::{constructor::Lifecycle, Blueprint}; +use pavex::f; + +pub struct Logger; + +pub fn new_logger() -> Logger { + todo!() +} + +pub fn add_logger(bp: &mut Blueprint) { + bp.constructor(f!(crate::new_logger), Lifecycle::Transient); +} diff --git a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_2/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_2/Cargo.toml new file mode 100644 index 000000000..8ba54551c --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_2/Cargo.toml @@ -0,0 +1,14 @@ +[workspace] +members = ["."] + +[package] +name = "dep_11a9a819" +version = "2.0.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies] +pavex = "1" diff --git a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_2/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_2/src/lib.rs new file mode 100644 index 000000000..88cdd832c --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/ephemeral_deps/dep_2/src/lib.rs @@ -0,0 +1,12 @@ +use pavex::blueprint::{constructor::Lifecycle, Blueprint}; +use pavex::f; + +pub struct Logger; + +pub fn new_logger() -> Logger { + todo!() +} + +pub fn add_logger(bp: &mut Blueprint) { + bp.constructor(f!(crate::new_logger), Lifecycle::Transient); +} diff --git a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/Cargo.toml new file mode 100644 index 000000000..cb2a21490 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_11a9a819" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/src/lib.rs new file mode 100644 index 000000000..1551eaf32 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/src/lib.rs @@ -0,0 +1,14 @@ +use pavex::blueprint::{constructor::Lifecycle, router::GET, Blueprint}; +use pavex::f; + +pub fn handler(_logger: dep_1::Logger, _logger_2: dep_2::Logger) -> pavex::response::Response { + todo!() +} + +pub fn blueprint() -> Blueprint { + let mut bp = Blueprint::new(); + dep_1::add_logger(&mut bp); + dep_2::add_logger(&mut bp); + bp.route(GET, "/home", f!(crate::handler)); + bp +} diff --git a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/src/main.rs b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/src/main.rs new file mode 100644 index 000000000..96521a535 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/src/main.rs @@ -0,0 +1,23 @@ +use app_11a9a819::blueprint; +use pavex_cli_client::commands::generate::GenerateError; +use pavex_cli_client::{config::Color, Client}; + +fn main() -> Result<(), Box> { + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), "generated_app".into()) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {} + Err(GenerateError::NonZeroExitCode(_)) => { + std::process::exit(1); + } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/Cargo.toml new file mode 100644 index 000000000..b1fa2d1f4 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "app_a0f4586a" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.dep] +path = "ephemeral_deps/dep" +package = "dep_a0f4586a" diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/diagnostics.dot b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/diagnostics.dot new file mode 100644 index 000000000..5a4802691 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/diagnostics.dot @@ -0,0 +1,43 @@ +digraph "GET /handler - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /handler - 1" { + 0 [ label = "dep_a0f4586a::handler(http_0_1_21::header::HeaderName, http_0_2_12::HeaderName) -> pavex::response::Response"] + 1 [ label = "dep_a0f4586a::header1() -> http_0_1_21::header::HeaderName"] + 2 [ label = "dep_a0f4586a::header2() -> http_0_2_12::HeaderName"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 2 -> 0 [ ] + 1 -> 0 [ ] + 0 -> 3 [ ] +} + +digraph "* /handler - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /handler - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/Cargo.toml new file mode 100644 index 000000000..3cd74697c --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "dep_a0f4586a" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[lints.rust.unused] +level = "allow" + +[dependencies.pavex] +workspace = true + +[dependencies.http_01] +package = "http" +version = "0.1" + +[dependencies.http_02] +package = "http" +version = "0.2" + +[dependencies.hyper] +version = "0.14" +features = ["server", "http1", "http2"] diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/dep.rs b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/dep.rs rename to libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/src/lib.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/app.rs b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/app.rs rename to libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/diagnostics.dot b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/diagnostics.dot rename to libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/stderr.txt b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/stderr.txt rename to libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml new file mode 100644 index 000000000..2e3ab79bf --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "application_a0f4586a" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +dep_a0f4586a = { version = "0.1.0", path = "../ephemeral_deps/dep" } +http_0_1_21 = { version = "0.1.21", package = "http" } +http_0_2_12 = { version = "0.2.12", package = "http" } +http_1_1_0 = { version = "1.1.0", package = "http" } +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/blueprint.ron b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/blueprint.ron new file mode 100644 index 000000000..1771c5cc8 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 5, + column: 18, + file: "reflection/crate_resolution/transitive_dependencies_can_be_renamed/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "dep_a0f4586a", + module_path: "dep_a0f4586a", + ), + import_path: "crate::header1", + ), + location: ( + line: 20, + column: 8, + file: "reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "dep_a0f4586a", + module_path: "dep_a0f4586a", + ), + import_path: "crate::header2", + ), + location: ( + line: 21, + column: 8, + file: "reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/handler", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "dep_a0f4586a", + module_path: "dep_a0f4586a", + ), + import_path: "crate::handler", + ), + location: ( + line: 22, + column: 8, + file: "reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/src/lib.rs new file mode 100644 index 000000000..172e19b1f --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/src/lib.rs @@ -0,0 +1,154 @@ +//! 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("/handler", 0u32).unwrap(); + router +} +async fn route_request( + request: http_1_1_0::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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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 = dep_a0f4586a::header2(); + let v1 = dep_a0f4586a::header1(); + let v2 = dep_a0f4586a::handler(v1, v0); + ::into_response(v2) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/lib.rs b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/lib.rs rename to libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/src/lib.rs diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/src/main.rs b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/src/main.rs new file mode 100644 index 000000000..99b49f610 --- /dev/null +++ b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_a0f4586a::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/test_config.toml b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/test_config.toml rename to libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/test_config.toml diff --git a/libs/ui_tests/reflection/generic_handlers_are_supported/Cargo.toml b/libs/ui_tests/reflection/generic_handlers_are_supported/Cargo.toml new file mode 100644 index 000000000..87418b2e6 --- /dev/null +++ b/libs/ui_tests/reflection/generic_handlers_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_603d81dd" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/generic_handlers_are_supported/diagnostics.dot b/libs/ui_tests/reflection/generic_handlers_are_supported/diagnostics.dot new file mode 100644 index 000000000..823b282f1 --- /dev/null +++ b/libs/ui_tests/reflection/generic_handlers_are_supported/diagnostics.dot @@ -0,0 +1,41 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_603d81dd::stream_file::(std::path::PathBuf) -> pavex::response::Response"] + 1 [ label = "app_603d81dd::path() -> std::path::PathBuf"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_handlers_are_supported/expectations/app.rs b/libs/ui_tests/reflection/generic_handlers_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/generic_handlers_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/generic_handlers_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_handlers_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/generic_handlers_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/generic_handlers_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/generic_handlers_are_supported/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_handlers_are_supported/expectations/stderr.txt b/libs/ui_tests/reflection/generic_handlers_are_supported/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/generic_handlers_are_supported/expectations/stderr.txt rename to libs/ui_tests/reflection/generic_handlers_are_supported/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..c8370b2e2 --- /dev/null +++ b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_603d81dd" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_603d81dd = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..ed034b206 --- /dev/null +++ b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 15, + column: 18, + file: "reflection/generic_handlers_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_603d81dd", + module_path: "app_603d81dd", + ), + import_path: "crate::path", + ), + location: ( + line: 16, + column: 8, + file: "reflection/generic_handlers_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_603d81dd", + module_path: "app_603d81dd", + ), + import_path: "crate::stream_file::", + ), + location: ( + line: 17, + column: 8, + file: "reflection/generic_handlers_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..e0ffd89f6 --- /dev/null +++ b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/src/lib.rs @@ -0,0 +1,153 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_603d81dd::path(); + let v1 = app_603d81dd::stream_file::(v0); + ::into_response(v1) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_handlers_are_supported/lib.rs b/libs/ui_tests/reflection/generic_handlers_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/generic_handlers_are_supported/lib.rs rename to libs/ui_tests/reflection/generic_handlers_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/generic_handlers_are_supported/src/main.rs b/libs/ui_tests/reflection/generic_handlers_are_supported/src/main.rs new file mode 100644 index 000000000..079a50b2e --- /dev/null +++ b/libs/ui_tests/reflection/generic_handlers_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_603d81dd::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_handlers_are_supported/test_config.toml b/libs/ui_tests/reflection/generic_handlers_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/generic_handlers_are_supported/test_config.toml rename to libs/ui_tests/reflection/generic_handlers_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/Cargo.toml b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/Cargo.toml new file mode 100644 index 000000000..804a73c0e --- /dev/null +++ b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "app_dcb9931d" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies] +hyper = "1.0.0-rc.4" +bytes = "1" + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.dep_1] +path = "ephemeral_deps/dep_1" +package = "dep_dcb9931d" diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/diagnostics.dot b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/diagnostics.dot new file mode 100644 index 000000000..08b7e9144 --- /dev/null +++ b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/diagnostics.dot @@ -0,0 +1,39 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_dcb9931d::handler() -> dep_dcb9931d::Custom"] + 1 [ label = " as pavex::response::IntoResponse>::into_response(dep_dcb9931d::Custom) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/ephemeral_deps/dep_1/Cargo.toml b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/ephemeral_deps/dep_1/Cargo.toml new file mode 100644 index 000000000..f0778944f --- /dev/null +++ b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/ephemeral_deps/dep_1/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "dep_dcb9931d" +version = "1.0.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[lints.rust.unused] +level = "allow" + +[dependencies.pavex] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/dep_1.rs b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/ephemeral_deps/dep_1/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/dep_1.rs rename to libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/ephemeral_deps/dep_1/src/lib.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/app.rs b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/app.rs rename to libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/diagnostics.dot b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/diagnostics.dot rename to libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml new file mode 100644 index 000000000..73bae9357 --- /dev/null +++ b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "application_dcb9931d" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_dcb9931d = { version = "0.1.0", path = ".." } +dep_dcb9931d = { version = "1.0.0", path = "../ephemeral_deps/dep_1" } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/blueprint.ron b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/blueprint.ron new file mode 100644 index 000000000..709876e13 --- /dev/null +++ b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/blueprint.ron @@ -0,0 +1,30 @@ +( + creation_location: ( + line: 8, + column: 18, + file: "reflection/generic_parameters_can_come_from_another_crate/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_dcb9931d", + module_path: "app_dcb9931d", + ), + import_path: "crate::handler", + ), + location: ( + line: 9, + column: 8, + file: "reflection/generic_parameters_can_come_from_another_crate/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/src/lib.rs b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/src/lib.rs new file mode 100644 index 000000000..ea822402d --- /dev/null +++ b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/src/lib.rs @@ -0,0 +1,154 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_dcb9931d::handler(); + as pavex::response::IntoResponse>::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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/lib.rs b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/lib.rs rename to libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/src/lib.rs diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/src/main.rs b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/src/main.rs new file mode 100644 index 000000000..f2dbc6f72 --- /dev/null +++ b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_dcb9931d::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/test_config.toml b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/generic_parameters_can_come_from_another_crate/test_config.toml rename to libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/test_config.toml diff --git a/libs/ui_tests/reflection/invalid_callable_path/Cargo.toml b/libs/ui_tests/reflection/invalid_callable_path/Cargo.toml new file mode 100644 index 000000000..e8ac8990d --- /dev/null +++ b/libs/ui_tests/reflection/invalid_callable_path/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_05806dea" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/reflection/invalid_callable_path/expectations/stderr.txt b/libs/ui_tests/reflection/invalid_callable_path/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/invalid_callable_path/expectations/stderr.txt rename to libs/ui_tests/reflection/invalid_callable_path/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/invalid_callable_path/generated_app/Cargo.toml b/libs/ui_tests/reflection/invalid_callable_path/generated_app/Cargo.toml new file mode 100644 index 000000000..27146d28d --- /dev/null +++ b/libs/ui_tests/reflection/invalid_callable_path/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_05806dea" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/reflection/invalid_callable_path/generated_app/blueprint.ron b/libs/ui_tests/reflection/invalid_callable_path/generated_app/blueprint.ron new file mode 100644 index 000000000..0f2509b39 --- /dev/null +++ b/libs/ui_tests/reflection/invalid_callable_path/generated_app/blueprint.ron @@ -0,0 +1,30 @@ +( + creation_location: ( + line: 6, + column: 18, + file: "reflection/invalid_callable_path/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "POST", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app", + module_path: "app", + ), + import_path: "my_f,", + ), + location: ( + line: 13, + column: 8, + file: "reflection/invalid_callable_path/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/invalid_callable_path/generated_app/src/lib.rs b/libs/ui_tests/reflection/invalid_callable_path/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/reflection/invalid_callable_path/lib.rs b/libs/ui_tests/reflection/invalid_callable_path/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/invalid_callable_path/lib.rs rename to libs/ui_tests/reflection/invalid_callable_path/src/lib.rs diff --git a/libs/ui_tests/reflection/invalid_callable_path/src/main.rs b/libs/ui_tests/reflection/invalid_callable_path/src/main.rs new file mode 100644 index 000000000..4a1bb99ca --- /dev/null +++ b/libs/ui_tests/reflection/invalid_callable_path/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_05806dea::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/invalid_callable_path/test_config.toml b/libs/ui_tests/reflection/invalid_callable_path/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/invalid_callable_path/test_config.toml rename to libs/ui_tests/reflection/invalid_callable_path/test_config.toml diff --git a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/Cargo.toml b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/Cargo.toml new file mode 100644 index 000000000..da3f1eafc --- /dev/null +++ b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_d56c0f9d" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/diagnostics.dot b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/diagnostics.dot new file mode 100644 index 000000000..7809903aa --- /dev/null +++ b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/diagnostics.dot @@ -0,0 +1,67 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a, 'b, 'c>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'c pavex::request::path::RawPathParams<'a, 'b>) -> crate::route_0::Next0<'a, 'b, 'c>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::request::path::RawPathParams<'server, 'request>"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_d56c0f9d::mw(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next1<'a, 'b, 'c>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next1(&'c pavex::request::path::RawPathParams<'a, 'b>) -> crate::route_0::Next1<'a, 'b, 'c>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::request::path::RawPathParams<'server, 'request>"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET / - 2" { + 0 [ label = "app_d56c0f9d::handler(&pavex::request::path::RawPathParams<'_, '_>) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::request::path::RawPathParams<'server, 'request>"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "app_d56c0f9d::mw(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next1<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next1(&'a pavex::router::AllowedMethods) -> crate::route_1::Next1<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* / - 2" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/lifetime_restrictions_are_handled/expectations/app.rs b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/lifetime_restrictions_are_handled/expectations/app.rs rename to libs/ui_tests/reflection/lifetime_restrictions_are_handled/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/lifetime_restrictions_are_handled/expectations/diagnostics.dot b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/lifetime_restrictions_are_handled/expectations/diagnostics.dot rename to libs/ui_tests/reflection/lifetime_restrictions_are_handled/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml new file mode 100644 index 000000000..bbc9ccf5c --- /dev/null +++ b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_d56c0f9d" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_d56c0f9d = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/blueprint.ron b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/blueprint.ron new file mode 100644 index 000000000..a4876139a --- /dev/null +++ b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/blueprint.ron @@ -0,0 +1,47 @@ +( + creation_location: ( + line: 19, + column: 18, + file: "reflection/lifetime_restrictions_are_handled/src/lib.rs", + ), + components: [ + WrappingMiddleware(( + middleware: ( + callable: ( + registered_at: ( + crate_name: "app_d56c0f9d", + module_path: "app_d56c0f9d", + ), + import_path: "crate::mw", + ), + location: ( + line: 20, + column: 8, + file: "reflection/lifetime_restrictions_are_handled/src/lib.rs", + ), + ), + error_handler: None, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_d56c0f9d", + module_path: "app_d56c0f9d", + ), + import_path: "crate::handler", + ), + location: ( + line: 21, + column: 8, + file: "reflection/lifetime_restrictions_are_handled/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/src/lib.rs b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/src/lib.rs new file mode 100644 index 000000000..f6aaaf9eb --- /dev/null +++ b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/src/lib.rs @@ -0,0 +1,230 @@ +//! 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("/", 0u32).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_1::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::GET => route_0::entrypoint(&url_params).await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a, 'b, 'c>( + s_0: &'c pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a, 'b, 'c>( + s_0: &'c pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = wrapping_1(s_0).await; + response + } + async fn stage_2<'a, 'b, 'c>( + s_0: &'c pavex::request::path::RawPathParams<'a, 'b>, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: &pavex::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = crate::route_0::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 wrapping_1( + v0: &pavex::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = crate::route_0::Next1 { + s_0: v0, + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_d56c0f9d::mw(v2); + ::into_response(v3) + } + async fn handler( + v0: &pavex::request::path::RawPathParams<'_, '_>, + ) -> pavex::response::Response { + let v1 = app_d56c0f9d::handler(v0); + ::into_response(v1) + } + struct Next0<'a, 'b, 'c, T> + where + T: std::future::Future, + { + s_0: &'c pavex::request::path::RawPathParams<'a, 'b>, + next: fn(&'c pavex::request::path::RawPathParams<'a, 'b>) -> T, + } + impl<'a, 'b, 'c, T> std::future::IntoFuture for Next0<'a, 'b, 'c, 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) + } + } + struct Next1<'a, 'b, 'c, T> + where + T: std::future::Future, + { + s_0: &'c pavex::request::path::RawPathParams<'a, 'b>, + next: fn(&'c pavex::request::path::RawPathParams<'a, 'b>) -> T, + } + impl<'a, 'b, 'c, T> std::future::IntoFuture for Next1<'a, 'b, 'c, 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) + } + } +} +pub mod route_1 { + 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 = wrapping_1(s_0).await; + response + } + async fn stage_2<'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_1::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 wrapping_1( + v0: &pavex::router::AllowedMethods, + ) -> pavex::response::Response { + let v1 = crate::route_1::Next1 { + s_0: v0, + next: stage_2, + }; + let v2 = pavex::middleware::Next::new(v1); + let v3 = app_d56c0f9d::mw(v2); + ::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) + } + } + struct Next1<'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 Next1<'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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/lifetime_restrictions_are_handled/lib.rs b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/lifetime_restrictions_are_handled/lib.rs rename to libs/ui_tests/reflection/lifetime_restrictions_are_handled/src/lib.rs diff --git a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/src/main.rs b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/src/main.rs new file mode 100644 index 000000000..fee90c067 --- /dev/null +++ b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_d56c0f9d::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/lifetime_restrictions_are_handled/test_config.toml b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/lifetime_restrictions_are_handled/test_config.toml rename to libs/ui_tests/reflection/lifetime_restrictions_are_handled/test_config.toml diff --git a/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/Cargo.toml b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/Cargo.toml new file mode 100644 index 000000000..9f48a30d0 --- /dev/null +++ b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_33cee83d" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/expectations/stderr.txt b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/expectations/stderr.txt rename to libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/Cargo.toml b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/Cargo.toml new file mode 100644 index 000000000..59ecf3ae6 --- /dev/null +++ b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_33cee83d" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/blueprint.ron b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/blueprint.ron new file mode 100644 index 000000000..e2e2bef6c --- /dev/null +++ b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/blueprint.ron @@ -0,0 +1,30 @@ +( + creation_location: ( + line: 9, + column: 18, + file: "reflection/local_callable_paths_must_be_prefixed_with_crate/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_33cee83d", + module_path: "app_33cee83d", + ), + import_path: "handler", + ), + location: ( + line: 10, + column: 8, + file: "reflection/local_callable_paths_must_be_prefixed_with_crate/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/src/lib.rs b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/lib.rs b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/lib.rs rename to libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/src/lib.rs diff --git a/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/src/main.rs b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/src/main.rs new file mode 100644 index 000000000..632b18568 --- /dev/null +++ b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_33cee83d::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/test_config.toml b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/test_config.toml rename to libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/test_config.toml diff --git a/libs/ui_tests/reflection/local_glob_reexports_are_supported/Cargo.toml b/libs/ui_tests/reflection/local_glob_reexports_are_supported/Cargo.toml new file mode 100644 index 000000000..54e21da61 --- /dev/null +++ b/libs/ui_tests/reflection/local_glob_reexports_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_e6a3fe43" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/local_glob_reexports_are_supported/diagnostics.dot b/libs/ui_tests/reflection/local_glob_reexports_are_supported/diagnostics.dot new file mode 100644 index 000000000..71a069a0b --- /dev/null +++ b/libs/ui_tests/reflection/local_glob_reexports_are_supported/diagnostics.dot @@ -0,0 +1,39 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_e6a3fe43::nested::function() -> http::StatusCode"] + 1 [ label = "::into_response(http::StatusCode) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/local_glob_reexports_are_supported/expectations/app.rs b/libs/ui_tests/reflection/local_glob_reexports_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/local_glob_reexports_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/local_glob_reexports_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/local_glob_reexports_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/local_glob_reexports_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/local_glob_reexports_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/local_glob_reexports_are_supported/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..d0e4c6c71 --- /dev/null +++ b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_e6a3fe43" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_e6a3fe43 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..ec4c57eae --- /dev/null +++ b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/blueprint.ron @@ -0,0 +1,30 @@ +( + creation_location: ( + line: 5, + column: 18, + file: "reflection/local_glob_reexports_are_supported/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_e6a3fe43", + module_path: "app_e6a3fe43", + ), + import_path: "crate::nested::function", + ), + location: ( + line: 6, + column: 8, + file: "reflection/local_glob_reexports_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..cd40660e3 --- /dev/null +++ b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/src/lib.rs @@ -0,0 +1,152 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_e6a3fe43::nested::function(); + ::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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/local_glob_reexports_are_supported/lib.rs b/libs/ui_tests/reflection/local_glob_reexports_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/local_glob_reexports_are_supported/lib.rs rename to libs/ui_tests/reflection/local_glob_reexports_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/local_glob_reexports_are_supported/src/main.rs b/libs/ui_tests/reflection/local_glob_reexports_are_supported/src/main.rs new file mode 100644 index 000000000..c6840ebab --- /dev/null +++ b/libs/ui_tests/reflection/local_glob_reexports_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_e6a3fe43::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/local_glob_reexports_are_supported/test_config.toml b/libs/ui_tests/reflection/local_glob_reexports_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/local_glob_reexports_are_supported/test_config.toml rename to libs/ui_tests/reflection/local_glob_reexports_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/non_static_methods_are_supported/Cargo.toml b/libs/ui_tests/reflection/non_static_methods_are_supported/Cargo.toml new file mode 100644 index 000000000..59f7ffb1c --- /dev/null +++ b/libs/ui_tests/reflection/non_static_methods_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_40e90d31" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/non_static_methods_are_supported/diagnostics.dot b/libs/ui_tests/reflection/non_static_methods_are_supported/diagnostics.dot new file mode 100644 index 000000000..fab57267b --- /dev/null +++ b/libs/ui_tests/reflection/non_static_methods_are_supported/diagnostics.dot @@ -0,0 +1,49 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a app_40e90d31::LoggerFactory) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_40e90d31::LoggerFactory"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_40e90d31::Streamer::stream_file(&app_40e90d31::Streamer, app_40e90d31::Logger) -> pavex::response::Response"] + 1 [ label = "app_40e90d31::Streamer::new() -> app_40e90d31::Streamer"] + 2 [ label = "app_40e90d31::LoggerFactory::logger(&app_40e90d31::LoggerFactory) -> app_40e90d31::Logger"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_40e90d31::LoggerFactory"] + 2 -> 0 [ ] + 1 -> 0 [ label = "&"] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_40e90d31::LoggerFactory) -> crate::ApplicationState"] + 1 [ label = "app_40e90d31::LoggerFactory::new() -> app_40e90d31::LoggerFactory"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/expectations/app.rs b/libs/ui_tests/reflection/non_static_methods_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/non_static_methods_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/non_static_methods_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/non_static_methods_are_supported/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/expectations/stderr.txt b/libs/ui_tests/reflection/non_static_methods_are_supported/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/expectations/stderr.txt rename to libs/ui_tests/reflection/non_static_methods_are_supported/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..6330846ee --- /dev/null +++ b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_40e90d31" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_40e90d31 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..156697a93 --- /dev/null +++ b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/blueprint.ron @@ -0,0 +1,90 @@ +( + creation_location: ( + line: 32, + column: 18, + file: "reflection/non_static_methods_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_40e90d31", + module_path: "app_40e90d31", + ), + import_path: "crate::Streamer::new", + ), + location: ( + line: 33, + column: 8, + file: "reflection/non_static_methods_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_40e90d31", + module_path: "app_40e90d31", + ), + import_path: "crate::LoggerFactory::new", + ), + location: ( + line: 34, + column: 8, + file: "reflection/non_static_methods_are_supported/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_40e90d31", + module_path: "app_40e90d31", + ), + import_path: "crate::LoggerFactory::logger", + ), + location: ( + line: 35, + column: 8, + file: "reflection/non_static_methods_are_supported/src/lib.rs", + ), + ), + lifecycle: Transient, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_40e90d31", + module_path: "app_40e90d31", + ), + import_path: "crate::Streamer::stream_file", + ), + location: ( + line: 36, + column: 8, + file: "reflection/non_static_methods_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..5b3bc5a34 --- /dev/null +++ b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/src/lib.rs @@ -0,0 +1,166 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_40e90d31::LoggerFactory, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_40e90d31::LoggerFactory::new(); + crate::ApplicationState { s0: v0 } +} +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("/home", 0u32).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_1::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::GET => { + route_0::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>( + s_0: &'a app_40e90d31::LoggerFactory, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>( + s_0: &'a app_40e90d31::LoggerFactory, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: &app_40e90d31::LoggerFactory) -> pavex::response::Response { + let v1 = crate::route_0::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: &app_40e90d31::LoggerFactory) -> pavex::response::Response { + let v1 = app_40e90d31::Streamer::new(); + let v3 = { + let v2 = app_40e90d31::LoggerFactory::logger(v0); + app_40e90d31::Streamer::stream_file(&v1, v2) + }; + ::into_response(v3) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_40e90d31::LoggerFactory, + next: fn(&'a app_40e90d31::LoggerFactory) -> 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) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/lib.rs b/libs/ui_tests/reflection/non_static_methods_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/lib.rs rename to libs/ui_tests/reflection/non_static_methods_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/non_static_methods_are_supported/src/main.rs b/libs/ui_tests/reflection/non_static_methods_are_supported/src/main.rs new file mode 100644 index 000000000..e5f66a856 --- /dev/null +++ b/libs/ui_tests/reflection/non_static_methods_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_40e90d31::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/test_config.toml b/libs/ui_tests/reflection/non_static_methods_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/non_static_methods_are_supported/test_config.toml rename to libs/ui_tests/reflection/non_static_methods_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/output_parameter_cannot_be_handled/Cargo.toml b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/Cargo.toml new file mode 100644 index 000000000..6744ea9e6 --- /dev/null +++ b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_e5e761b9" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/reflection/output_parameter_cannot_be_handled/expectations/stderr.txt b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/output_parameter_cannot_be_handled/expectations/stderr.txt rename to libs/ui_tests/reflection/output_parameter_cannot_be_handled/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/Cargo.toml b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/Cargo.toml new file mode 100644 index 000000000..7fe3d8587 --- /dev/null +++ b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_e5e761b9" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/blueprint.ron b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/blueprint.ron new file mode 100644 index 000000000..8b58349fc --- /dev/null +++ b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/blueprint.ron @@ -0,0 +1,30 @@ +( + creation_location: ( + line: 9, + column: 18, + file: "reflection/output_parameter_cannot_be_handled/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_e5e761b9", + module_path: "app_e5e761b9", + ), + import_path: "crate::c", + ), + location: ( + line: 10, + column: 8, + file: "reflection/output_parameter_cannot_be_handled/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/src/lib.rs b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/reflection/output_parameter_cannot_be_handled/lib.rs b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/output_parameter_cannot_be_handled/lib.rs rename to libs/ui_tests/reflection/output_parameter_cannot_be_handled/src/lib.rs diff --git a/libs/ui_tests/reflection/output_parameter_cannot_be_handled/src/main.rs b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/src/main.rs new file mode 100644 index 000000000..f257106af --- /dev/null +++ b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_e5e761b9::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/output_parameter_cannot_be_handled/test_config.toml b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/output_parameter_cannot_be_handled/test_config.toml rename to libs/ui_tests/reflection/output_parameter_cannot_be_handled/test_config.toml diff --git a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/Cargo.toml b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/Cargo.toml new file mode 100644 index 000000000..8611af04b --- /dev/null +++ b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_d1b695a6" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/diagnostics.dot b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/diagnostics.dot new file mode 100644 index 000000000..c5027adcd --- /dev/null +++ b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/diagnostics.dot @@ -0,0 +1,45 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a app_d1b695a6::Streamer) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&app_d1b695a6::Streamer"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_d1b695a6::stream_file(&app_d1b695a6::Streamer) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&app_d1b695a6::Streamer"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(app_d1b695a6::Streamer) -> crate::ApplicationState"] + 1 [ label = "app_d1b695a6::streamer() -> app_d1b695a6::Streamer"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/app.rs b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..087568731 --- /dev/null +++ b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_d1b695a6" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_d1b695a6 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..0e0d34075 --- /dev/null +++ b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 19, + column: 18, + file: "reflection/pattern_bindings_in_input_parameters_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d1b695a6", + module_path: "app_d1b695a6", + ), + import_path: "crate::streamer", + ), + location: ( + line: 20, + column: 8, + file: "reflection/pattern_bindings_in_input_parameters_are_supported/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_d1b695a6", + module_path: "app_d1b695a6", + ), + import_path: "crate::stream_file", + ), + location: ( + line: 21, + column: 8, + file: "reflection/pattern_bindings_in_input_parameters_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..3b76fe7b8 --- /dev/null +++ b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/src/lib.rs @@ -0,0 +1,160 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: app_d1b695a6::Streamer, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_d1b695a6::streamer(); + crate::ApplicationState { s0: v0 } +} +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("/home", 0u32).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_1::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::GET => { + route_0::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>( + s_0: &'a app_d1b695a6::Streamer, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>(s_0: &'a app_d1b695a6::Streamer) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: &app_d1b695a6::Streamer) -> pavex::response::Response { + let v1 = crate::route_0::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: &app_d1b695a6::Streamer) -> pavex::response::Response { + let v1 = app_d1b695a6::stream_file(v0); + ::into_response(v1) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a app_d1b695a6::Streamer, + next: fn(&'a app_d1b695a6::Streamer) -> 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) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/lib.rs b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/lib.rs rename to libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/src/main.rs b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/src/main.rs new file mode 100644 index 000000000..6145ea884 --- /dev/null +++ b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_d1b695a6::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/test_config.toml b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/test_config.toml rename to libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/Cargo.toml b/libs/ui_tests/reflection/reexported_type_alias_work/Cargo.toml new file mode 100644 index 000000000..55a92a01b --- /dev/null +++ b/libs/ui_tests/reflection/reexported_type_alias_work/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "app_065fd341" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.dep] +path = "ephemeral_deps/dep" +package = "dep_065fd341" diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/diagnostics.dot b/libs/ui_tests/reflection/reexported_type_alias_work/diagnostics.dot new file mode 100644 index 000000000..f80b03670 --- /dev/null +++ b/libs/ui_tests/reflection/reexported_type_alias_work/diagnostics.dot @@ -0,0 +1,45 @@ +digraph "GET / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0(&'a dep_065fd341::Surreal) -> crate::route_0::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&dep_065fd341::Surreal"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "GET / - 1" { + 0 [ label = "app_065fd341::handler(&dep_065fd341::Surreal) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&dep_065fd341::Surreal"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph "* / - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* / - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState(dep_065fd341::Surreal) -> crate::ApplicationState"] + 1 [ label = "app_065fd341::constructor() -> dep_065fd341::Surreal"] + 1 -> 0 [ ] +} diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/ephemeral_deps/dep/Cargo.toml b/libs/ui_tests/reflection/reexported_type_alias_work/ephemeral_deps/dep/Cargo.toml new file mode 100644 index 000000000..534c73362 --- /dev/null +++ b/libs/ui_tests/reflection/reexported_type_alias_work/ephemeral_deps/dep/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "dep_065fd341" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[lints.rust.unused] +level = "allow" + +[dependencies.pavex] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/dep.rs b/libs/ui_tests/reflection/reexported_type_alias_work/ephemeral_deps/dep/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/dep.rs rename to libs/ui_tests/reflection/reexported_type_alias_work/ephemeral_deps/dep/src/lib.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/app.rs b/libs/ui_tests/reflection/reexported_type_alias_work/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/app.rs rename to libs/ui_tests/reflection/reexported_type_alias_work/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/diagnostics.dot b/libs/ui_tests/reflection/reexported_type_alias_work/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/expectations/diagnostics.dot rename to libs/ui_tests/reflection/reexported_type_alias_work/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml new file mode 100644 index 000000000..663e78d6d --- /dev/null +++ b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "application_065fd341" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_065fd341 = { version = "0.1.0", path = ".." } +dep_065fd341 = { version = "0.1.0", path = "../ephemeral_deps/dep" } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/blueprint.ron b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/blueprint.ron new file mode 100644 index 000000000..6a94d75f0 --- /dev/null +++ b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 16, + column: 18, + file: "reflection/reexported_type_alias_work/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_065fd341", + module_path: "app_065fd341", + ), + import_path: "crate::constructor", + ), + location: ( + line: 17, + column: 8, + file: "reflection/reexported_type_alias_work/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_065fd341", + module_path: "app_065fd341", + ), + import_path: "crate::handler", + ), + location: ( + line: 18, + column: 8, + file: "reflection/reexported_type_alias_work/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/src/lib.rs b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/src/lib.rs new file mode 100644 index 000000000..00dd58397 --- /dev/null +++ b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/src/lib.rs @@ -0,0 +1,166 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: dep_065fd341::Surreal, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_065fd341::constructor(); + crate::ApplicationState { s0: v0 } +} +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("/", 0u32).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_1::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::GET => { + route_0::entrypoint(&server_state.application_state.s0).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>( + s_0: &'a dep_065fd341::Surreal, + ) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1<'a>( + s_0: &'a dep_065fd341::Surreal, + ) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0( + v0: &dep_065fd341::Surreal, + ) -> pavex::response::Response { + let v1 = crate::route_0::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: &dep_065fd341::Surreal, + ) -> pavex::response::Response { + let v1 = app_065fd341::handler(v0); + ::into_response(v1) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: &'a dep_065fd341::Surreal, + next: fn(&'a dep_065fd341::Surreal) -> 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) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/lib.rs b/libs/ui_tests/reflection/reexported_type_alias_work/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/lib.rs rename to libs/ui_tests/reflection/reexported_type_alias_work/src/lib.rs diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/src/main.rs b/libs/ui_tests/reflection/reexported_type_alias_work/src/main.rs new file mode 100644 index 000000000..525fda9b2 --- /dev/null +++ b/libs/ui_tests/reflection/reexported_type_alias_work/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_065fd341::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/test_config.toml b/libs/ui_tests/reflection/reexported_type_alias_work/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/reexported_type_alias_work/test_config.toml rename to libs/ui_tests/reflection/reexported_type_alias_work/test_config.toml diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/Cargo.toml b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/Cargo.toml new file mode 100644 index 000000000..de654452e --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_698936eb" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/diagnostics.dot b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/diagnostics.dot new file mode 100644 index 000000000..51f47c145 --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/diagnostics.dot @@ -0,0 +1,41 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_698936eb::handler(app_698936eb::my_mod::A) -> pavex::response::Response"] + 1 [ label = "app_698936eb::my_mod::A::::new() -> app_698936eb::my_mod::A"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/expectations/app.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..85cfdab2f --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_698936eb" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_698936eb = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..8d6f9edcc --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 9, + column: 18, + file: "reflection/relative_paths_prefixed_with_self_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_698936eb", + module_path: "app_698936eb::my_mod", + ), + import_path: "self::A::::new", + ), + location: ( + line: 20, + column: 12, + file: "reflection/relative_paths_prefixed_with_self_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_698936eb", + module_path: "app_698936eb", + ), + import_path: "self::handler", + ), + location: ( + line: 11, + column: 8, + file: "reflection/relative_paths_prefixed_with_self_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..7efa827a4 --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/src/lib.rs @@ -0,0 +1,153 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_698936eb::my_mod::A::::new(); + let v1 = app_698936eb::handler(v0); + ::into_response(v1) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/lib.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/lib.rs rename to libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/src/main.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/src/main.rs new file mode 100644 index 000000000..72a7f4835 --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_698936eb::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/test_config.toml b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/test_config.toml rename to libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/Cargo.toml b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/Cargo.toml new file mode 100644 index 000000000..50b48b747 --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_ec0f16d1" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/diagnostics.dot b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/diagnostics.dot new file mode 100644 index 000000000..998774f05 --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/diagnostics.dot @@ -0,0 +1,41 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_ec0f16d1::handler(app_ec0f16d1::A) -> pavex::response::Response"] + 1 [ label = "app_ec0f16d1::A::::new() -> app_ec0f16d1::A"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/expectations/app.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..e9fb0f583 --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_ec0f16d1" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_ec0f16d1 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..17fb274e4 --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 17, + column: 18, + file: "reflection/relative_paths_prefixed_with_super_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ec0f16d1", + module_path: "app_ec0f16d1::my_mod", + ), + import_path: "super::A::::new", + ), + location: ( + line: 27, + column: 12, + file: "reflection/relative_paths_prefixed_with_super_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ec0f16d1", + module_path: "app_ec0f16d1::my_mod", + ), + import_path: "super::handler", + ), + location: ( + line: 28, + column: 12, + file: "reflection/relative_paths_prefixed_with_super_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..9bac962c0 --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/src/lib.rs @@ -0,0 +1,153 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_ec0f16d1::A::::new(); + let v1 = app_ec0f16d1::handler(v0); + ::into_response(v1) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/lib.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/lib.rs rename to libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/src/main.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/src/main.rs new file mode 100644 index 000000000..8337782a0 --- /dev/null +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ec0f16d1::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/test_config.toml b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/test_config.toml rename to libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/Cargo.toml b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/Cargo.toml new file mode 100644 index 000000000..c6066ed0b --- /dev/null +++ b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "app_d89d2d61" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies] +anyhow = "1.0" + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/diagnostics.dot b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/diagnostics.dot new file mode 100644 index 000000000..a43e2baaa --- /dev/null +++ b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/diagnostics.dot @@ -0,0 +1,51 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_d89d2d61::handler(app_d89d2d61::A) -> pavex::response::Response"] + 1 [ label = "core::prelude::rust_2015::Result -> app_d89d2d61::A"] + 2 [ label = "app_d89d2d61::A::new() -> core::prelude::rust_2015::Result"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "core::prelude::rust_2015::Result -> anyhow::Error"] + 5 [ label = "app_d89d2d61::error_handler(&anyhow::Error) -> pavex::response::Response"] + 6 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 7 [ label = "`match`"] + 1 -> 0 [ ] + 7 -> 4 [ ] + 7 -> 1 [ ] + 0 -> 3 [ ] + 4 -> 5 [ label = "&"] + 5 -> 6 [ ] + 2 -> 7 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/app.rs b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/app.rs rename to libs/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/stderr.txt b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/stderr.txt rename to libs/ui_tests/reflection/self_as_generic_parameter_is_supported/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..d6eea4380 --- /dev/null +++ b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "application_d89d2d61" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +anyhow = "1.0.87" +app_d89d2d61 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..1bfdbe0c8 --- /dev/null +++ b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/blueprint.ron @@ -0,0 +1,63 @@ +( + creation_location: ( + line: 23, + column: 18, + file: "reflection/self_as_generic_parameter_is_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_d89d2d61", + module_path: "app_d89d2d61", + ), + import_path: "crate::A::new", + ), + location: ( + line: 24, + column: 8, + file: "reflection/self_as_generic_parameter_is_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: Some(( + callable: ( + registered_at: ( + crate_name: "app_d89d2d61", + module_path: "app_d89d2d61", + ), + import_path: "crate::error_handler", + ), + location: ( + line: 25, + column: 10, + file: "reflection/self_as_generic_parameter_is_supported/src/lib.rs", + ), + )), + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_d89d2d61", + module_path: "app_d89d2d61", + ), + import_path: "crate::handler", + ), + location: ( + line: 26, + column: 8, + file: "reflection/self_as_generic_parameter_is_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..943c0ae58 --- /dev/null +++ b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/src/lib.rs @@ -0,0 +1,164 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_d89d2d61::A::new(); + let v1 = match v0 { + Ok(ok) => ok, + Err(v1) => { + return { + let v2 = app_d89d2d61::error_handler(&v1); + ::into_response( + v2, + ) + }; + } + }; + let v2 = app_d89d2d61::handler(v1); + ::into_response(v2) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/self_as_generic_parameter_is_supported/lib.rs b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/self_as_generic_parameter_is_supported/lib.rs rename to libs/ui_tests/reflection/self_as_generic_parameter_is_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/src/main.rs b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/src/main.rs new file mode 100644 index 000000000..2496604c9 --- /dev/null +++ b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_d89d2d61::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/self_as_generic_parameter_is_supported/test_config.toml b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/self_as_generic_parameter_is_supported/test_config.toml rename to libs/ui_tests/reflection/self_as_generic_parameter_is_supported/test_config.toml diff --git a/libs/ui_tests/reflection/static_methods_are_supported/Cargo.toml b/libs/ui_tests/reflection/static_methods_are_supported/Cargo.toml new file mode 100644 index 000000000..491dd1f02 --- /dev/null +++ b/libs/ui_tests/reflection/static_methods_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_d50c6d0c" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/static_methods_are_supported/diagnostics.dot b/libs/ui_tests/reflection/static_methods_are_supported/diagnostics.dot new file mode 100644 index 000000000..83de8596a --- /dev/null +++ b/libs/ui_tests/reflection/static_methods_are_supported/diagnostics.dot @@ -0,0 +1,39 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_d50c6d0c::Streamer::stream_file() -> pavex::response::Response"] + 1 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 0 -> 1 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/static_methods_are_supported/expectations/app.rs b/libs/ui_tests/reflection/static_methods_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/static_methods_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/static_methods_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/static_methods_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/static_methods_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/static_methods_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/static_methods_are_supported/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..539793169 --- /dev/null +++ b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_d50c6d0c" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_d50c6d0c = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..9b72eddb8 --- /dev/null +++ b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/blueprint.ron @@ -0,0 +1,30 @@ +( + creation_location: ( + line: 13, + column: 18, + file: "reflection/static_methods_are_supported/src/lib.rs", + ), + components: [ + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_d50c6d0c", + module_path: "app_d50c6d0c", + ), + import_path: "crate::Streamer::stream_file", + ), + location: ( + line: 14, + column: 8, + file: "reflection/static_methods_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..16f59205d --- /dev/null +++ b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/src/lib.rs @@ -0,0 +1,152 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_d50c6d0c::Streamer::stream_file(); + ::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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/static_methods_are_supported/lib.rs b/libs/ui_tests/reflection/static_methods_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/static_methods_are_supported/lib.rs rename to libs/ui_tests/reflection/static_methods_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/static_methods_are_supported/src/main.rs b/libs/ui_tests/reflection/static_methods_are_supported/src/main.rs new file mode 100644 index 000000000..85336a2a2 --- /dev/null +++ b/libs/ui_tests/reflection/static_methods_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_d50c6d0c::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/static_methods_are_supported/test_config.toml b/libs/ui_tests/reflection/static_methods_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/static_methods_are_supported/test_config.toml rename to libs/ui_tests/reflection/static_methods_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/Cargo.toml b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/Cargo.toml new file mode 100644 index 000000000..76b53b5b4 --- /dev/null +++ b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_9adade88" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/expectations/stderr.txt b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/expectations/stderr.txt rename to libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/Cargo.toml b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/Cargo.toml new file mode 100644 index 000000000..5aff974d7 --- /dev/null +++ b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "application_9adade88" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" diff --git a/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/blueprint.ron b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/blueprint.ron new file mode 100644 index 000000000..fcd455a77 --- /dev/null +++ b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 15, + column: 18, + file: "reflection/the_path_for_generic_arguments_must_be_absolute/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_9adade88", + module_path: "app_9adade88", + ), + import_path: "crate::new_logger::", + ), + location: ( + line: 16, + column: 8, + file: "reflection/the_path_for_generic_arguments_must_be_absolute/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_9adade88", + module_path: "app_9adade88", + ), + import_path: "crate::handler::", + ), + location: ( + line: 17, + column: 8, + file: "reflection/the_path_for_generic_arguments_must_be_absolute/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/src/lib.rs b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/libs/pavex_cli/tests/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/lib.rs b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/lib.rs rename to libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/src/lib.rs diff --git a/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/src/main.rs b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/src/main.rs new file mode 100644 index 000000000..12411d06e --- /dev/null +++ b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_9adade88::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/test_config.toml b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/test_config.toml rename to libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/test_config.toml diff --git a/libs/ui_tests/reflection/trait_methods_are_supported/Cargo.toml b/libs/ui_tests/reflection/trait_methods_are_supported/Cargo.toml new file mode 100644 index 000000000..9d39101cc --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_a7fd6a2c" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/trait_methods_are_supported/diagnostics.dot b/libs/ui_tests/reflection/trait_methods_are_supported/diagnostics.dot new file mode 100644 index 000000000..179e9da05 --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_are_supported/diagnostics.dot @@ -0,0 +1,52 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_a7fd6a2c::handler(app_a7fd6a2c::A, app_a7fd6a2c::C, app_a7fd6a2c::D, app_a7fd6a2c::E) -> pavex::response::Response"] + 1 [ label = "::a_method_that_returns_self() -> app_a7fd6a2c::A"] + 2 [ label = "::a_method_that_consumes_self(app_a7fd6a2c::B) -> app_a7fd6a2c::C"] + 3 [ label = "::a_method_with_a_generic::(&app_a7fd6a2c::A) -> app_a7fd6a2c::D"] + 4 [ label = ">::a_method(&app_a7fd6a2c::C) -> app_a7fd6a2c::E"] + 5 [ label = "::a_method_that_borrows_self(&app_a7fd6a2c::A) -> app_a7fd6a2c::B"] + 6 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 -> 0 [ ] + 2 -> 4 [ label = "&"] + 5 -> 2 [ ] + 1 -> 5 [ label = "&"] + 3 -> 0 [ ] + 1 -> 3 [ label = "&"] + 2 -> 0 [ ] + 1 -> 0 [ ] + 0 -> 6 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/expectations/app.rs b/libs/ui_tests/reflection/trait_methods_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/trait_methods_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/trait_methods_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/trait_methods_are_supported/expectations/diagnostics.dot diff --git a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..0cb43c3aa --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_a7fd6a2c" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_a7fd6a2c = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..818fb77de --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/blueprint.ron @@ -0,0 +1,130 @@ +( + creation_location: ( + line: 57, + column: 18, + file: "reflection/trait_methods_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_a7fd6a2c", + module_path: "app_a7fd6a2c", + ), + import_path: "::a_method_that_returns_self", + ), + location: ( + line: 58, + column: 8, + file: "reflection/trait_methods_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_a7fd6a2c", + module_path: "app_a7fd6a2c", + ), + import_path: "::a_method_that_borrows_self", + ), + location: ( + line: 62, + column: 8, + file: "reflection/trait_methods_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_a7fd6a2c", + module_path: "app_a7fd6a2c", + ), + import_path: "::a_method_with_a_generic::", + ), + location: ( + line: 66, + column: 8, + file: "reflection/trait_methods_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_a7fd6a2c", + module_path: "app_a7fd6a2c", + ), + import_path: "::a_method_that_consumes_self", + ), + location: ( + line: 70, + column: 8, + file: "reflection/trait_methods_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_a7fd6a2c", + module_path: "app_a7fd6a2c", + ), + import_path: ">::a_method", + ), + location: ( + line: 74, + column: 8, + file: "reflection/trait_methods_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_a7fd6a2c", + module_path: "app_a7fd6a2c", + ), + import_path: "crate::handler", + ), + location: ( + line: 78, + column: 8, + file: "reflection/trait_methods_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..55c045569 --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/src/lib.rs @@ -0,0 +1,165 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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 = ::a_method_that_returns_self(); + let v1 = ::a_method_that_borrows_self( + &v0, + ); + let v2 = ::a_method_that_consumes_self( + v1, + ); + let v3 = >::a_method(&v2); + let v4 = ::a_method_with_a_generic::< + std::string::String, + >(&v0); + let v5 = app_a7fd6a2c::handler(v0, v2, v4, v3); + ::into_response(v5) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/lib.rs b/libs/ui_tests/reflection/trait_methods_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/lib.rs rename to libs/ui_tests/reflection/trait_methods_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/trait_methods_are_supported/src/main.rs b/libs/ui_tests/reflection/trait_methods_are_supported/src/main.rs new file mode 100644 index 000000000..d08903332 --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_a7fd6a2c::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/test_config.toml b/libs/ui_tests/reflection/trait_methods_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/trait_methods_are_supported/test_config.toml rename to libs/ui_tests/reflection/trait_methods_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/Cargo.toml b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/Cargo.toml new file mode 100644 index 000000000..6426cd656 --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_ecefbcb0" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/diagnostics.dot b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/diagnostics.dot new file mode 100644 index 000000000..3845eb003 --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/diagnostics.dot @@ -0,0 +1,43 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0() -> crate::route_0::Next0"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 3 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_ecefbcb0::handler(app_ecefbcb0::A, app_ecefbcb0::B) -> pavex::response::Response"] + 1 [ label = ">::a_method_using_the_trait_generic_param() -> app_ecefbcb0::A"] + 2 [ label = "app_ecefbcb0::b_constructor() -> app_ecefbcb0::B"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 2 -> 0 [ ] + 1 -> 0 [ ] + 0 -> 3 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState() -> crate::ApplicationState"] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/app.rs b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/stderr.txt b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/stderr.txt rename to libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..23edfbf9c --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_ecefbcb0" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_ecefbcb0 = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..addb24549 --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 27, + column: 18, + file: "reflection/trait_methods_with_non_local_generics_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ecefbcb0", + module_path: "app_ecefbcb0", + ), + import_path: "crate::b_constructor", + ), + location: ( + line: 28, + column: 8, + file: "reflection/trait_methods_with_non_local_generics_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_ecefbcb0", + module_path: "app_ecefbcb0", + ), + import_path: ">::a_method_using_the_trait_generic_param", + ), + location: ( + line: 29, + column: 8, + file: "reflection/trait_methods_with_non_local_generics_are_supported/src/lib.rs", + ), + ), + lifecycle: RequestScoped, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_ecefbcb0", + module_path: "app_ecefbcb0", + ), + import_path: "crate::handler", + ), + location: ( + line: 33, + column: 8, + file: "reflection/trait_methods_with_non_local_generics_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..5815de7c3 --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/src/lib.rs @@ -0,0 +1,156 @@ +//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::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_ecefbcb0::b_constructor(); + let v1 = >::a_method_using_the_trait_generic_param(); + let v2 = app_ecefbcb0::handler(v1, v0); + ::into_response(v2) + } + 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<'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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/lib.rs b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/lib.rs rename to libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/src/main.rs b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/src/main.rs new file mode 100644 index 000000000..3f0089d79 --- /dev/null +++ b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_ecefbcb0::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/test_config.toml b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/test_config.toml rename to libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/tuples_are_supported/Cargo.toml b/libs/ui_tests/reflection/tuples_are_supported/Cargo.toml new file mode 100644 index 000000000..8a664299f --- /dev/null +++ b/libs/ui_tests/reflection/tuples_are_supported/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "app_1bd0738c" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true diff --git a/libs/ui_tests/reflection/tuples_are_supported/diagnostics.dot b/libs/ui_tests/reflection/tuples_are_supported/diagnostics.dot new file mode 100644 index 000000000..1e1a9ed3a --- /dev/null +++ b/libs/ui_tests/reflection/tuples_are_supported/diagnostics.dot @@ -0,0 +1,45 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0) -> pavex::middleware::Next"] + 2 [ label = "crate::route_0::Next0((usize, isize)) -> crate::route_0::Next0"] + 3 [ label = "(usize, isize)"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 4 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_1bd0738c::handler_with_input_tuple((usize, isize)) -> pavex::response::Response"] + 1 [ label = "(usize, isize)"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 1 -> 0 [ ] + 0 -> 2 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState((usize, isize)) -> crate::ApplicationState"] + 1 [ label = "app_1bd0738c::constructor_with_output_tuple() -> (usize, isize)"] + 1 -> 0 [ ] +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/tuples_are_supported/expectations/app.rs b/libs/ui_tests/reflection/tuples_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/tuples_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/tuples_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/tuples_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/tuples_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/tuples_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/tuples_are_supported/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/reflection/tuples_are_supported/expectations/stderr.txt b/libs/ui_tests/reflection/tuples_are_supported/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/tuples_are_supported/expectations/stderr.txt rename to libs/ui_tests/reflection/tuples_are_supported/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..2eecb5466 --- /dev/null +++ b/libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "application_1bd0738c" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_1bd0738c = { version = "0.1.0", path = ".." } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/tuples_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/tuples_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..d330abda5 --- /dev/null +++ b/libs/ui_tests/reflection/tuples_are_supported/generated_app/blueprint.ron @@ -0,0 +1,50 @@ +( + creation_location: ( + line: 13, + column: 18, + file: "reflection/tuples_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_1bd0738c", + module_path: "app_1bd0738c", + ), + import_path: "crate::constructor_with_output_tuple", + ), + location: ( + line: 14, + column: 8, + file: "reflection/tuples_are_supported/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_1bd0738c", + module_path: "app_1bd0738c", + ), + import_path: "crate::handler_with_input_tuple", + ), + location: ( + line: 18, + column: 8, + file: "reflection/tuples_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/tuples_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/tuples_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..4cab3cc66 --- /dev/null +++ b/libs/ui_tests/reflection/tuples_are_supported/generated_app/src/lib.rs @@ -0,0 +1,158 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: (usize, isize), +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_1bd0738c::constructor_with_output_tuple(); + crate::ApplicationState { s0: v0 } +} +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("/home", 0u32).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_1::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::GET => { + route_0::entrypoint(server_state.application_state.s0.clone()).await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint(s_0: (usize, isize)) -> pavex::response::Response { + let response = wrapping_0(s_0).await; + response + } + async fn stage_1(s_0: (usize, isize)) -> pavex::response::Response { + let response = handler(s_0).await; + response + } + async fn wrapping_0(v0: (usize, isize)) -> pavex::response::Response { + let v1 = crate::route_0::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: (usize, isize)) -> pavex::response::Response { + let v1 = app_1bd0738c::handler_with_input_tuple(v0); + ::into_response(v1) + } + struct Next0 + where + T: std::future::Future, + { + s_0: (usize, isize), + next: fn((usize, isize)) -> 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)(self.s_0) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/tuples_are_supported/lib.rs b/libs/ui_tests/reflection/tuples_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/tuples_are_supported/lib.rs rename to libs/ui_tests/reflection/tuples_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/tuples_are_supported/src/main.rs b/libs/ui_tests/reflection/tuples_are_supported/src/main.rs new file mode 100644 index 000000000..5185a1dd3 --- /dev/null +++ b/libs/ui_tests/reflection/tuples_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_1bd0738c::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/tuples_are_supported/test_config.toml b/libs/ui_tests/reflection/tuples_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/tuples_are_supported/test_config.toml rename to libs/ui_tests/reflection/tuples_are_supported/test_config.toml diff --git a/libs/ui_tests/reflection/type_alias_are_supported/Cargo.toml b/libs/ui_tests/reflection/type_alias_are_supported/Cargo.toml new file mode 100644 index 000000000..2b2b11d0d --- /dev/null +++ b/libs/ui_tests/reflection/type_alias_are_supported/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "app_f8f62968" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[dependencies.pavex] +workspace = true + +[dependencies.pavex_cli_client] +workspace = true + +[dependencies.workspace_hack] +workspace = true + +[dependencies.dep] +path = "ephemeral_deps/dep" +package = "dep_f8f62968" diff --git a/libs/ui_tests/reflection/type_alias_are_supported/diagnostics.dot b/libs/ui_tests/reflection/type_alias_are_supported/diagnostics.dot new file mode 100644 index 000000000..b330c4f7f --- /dev/null +++ b/libs/ui_tests/reflection/type_alias_are_supported/diagnostics.dot @@ -0,0 +1,51 @@ +digraph "GET /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_0::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_0::Next0((bool, char, u8), &'a dep_f8f62968::ActualType) -> crate::route_0::Next0<'a>"] + 3 [ label = "(bool, char, u8)"] + 5 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 6 [ label = "&dep_f8f62968::ActualType"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 3 -> 2 [ ] + 0 -> 5 [ ] + 6 -> 2 [ ] +} + +digraph "GET /home - 1" { + 0 [ label = "app_f8f62968::handler_with_input_tuple((bool, char, u8), &dep_f8f62968::ActualType) -> pavex::response::Response"] + 1 [ label = "(bool, char, u8)"] + 3 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 4 [ label = "&dep_f8f62968::ActualType"] + 1 -> 0 [ ] + 0 -> 3 [ ] + 4 -> 0 [ ] +} + +digraph "* /home - 0" { + 0 [ label = "pavex::middleware::wrap_noop(pavex::middleware::Next>) -> pavex::response::Response"] + 1 [ label = "pavex::middleware::Next::new(crate::route_1::Next0<'a>) -> pavex::middleware::Next>"] + 2 [ label = "crate::route_1::Next0(&'a pavex::router::AllowedMethods) -> crate::route_1::Next0<'a>"] + 4 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 5 [ label = "&pavex::router::AllowedMethods"] + 1 -> 0 [ ] + 2 -> 1 [ ] + 0 -> 4 [ ] + 5 -> 2 [ ] +} + +digraph "* /home - 1" { + 0 [ label = "pavex::router::default_fallback(&pavex::router::AllowedMethods) -> pavex::response::Response"] + 2 [ label = "::into_response(pavex::response::Response) -> pavex::response::Response"] + 3 [ label = "&pavex::router::AllowedMethods"] + 0 -> 2 [ ] + 3 -> 0 [ ] +} + +digraph app_state { + 0 [ label = "crate::ApplicationState((bool, char, u8), dep_f8f62968::ActualType) -> crate::ApplicationState"] + 1 [ label = "app_f8f62968::constructor_with_output_tuple() -> (bool, char, u8)"] + 2 [ label = "app_f8f62968::RemoteAlias::new() -> dep_f8f62968::ActualType"] + 2 -> 0 [ ] + 1 -> 0 [ ] +} diff --git a/libs/ui_tests/reflection/type_alias_are_supported/ephemeral_deps/dep/Cargo.toml b/libs/ui_tests/reflection/type_alias_are_supported/ephemeral_deps/dep/Cargo.toml new file mode 100644 index 000000000..df975c269 --- /dev/null +++ b/libs/ui_tests/reflection/type_alias_are_supported/ephemeral_deps/dep/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "dep_f8f62968" +version = "0.1.0" +edition = "2021" + +[lints.rust.unexpected_cfgs] +level = "allow" +check-cfg = ["cfg(pavex_ide_hint)"] + +[lints.rust.unused] +level = "allow" + +[dependencies.pavex] +workspace = true diff --git a/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/dep.rs b/libs/ui_tests/reflection/type_alias_are_supported/ephemeral_deps/dep/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/dep.rs rename to libs/ui_tests/reflection/type_alias_are_supported/ephemeral_deps/dep/src/lib.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/app.rs b/libs/ui_tests/reflection/type_alias_are_supported/expectations/app.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/app.rs rename to libs/ui_tests/reflection/type_alias_are_supported/expectations/app.rs diff --git a/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/diagnostics.dot b/libs/ui_tests/reflection/type_alias_are_supported/expectations/diagnostics.dot similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/diagnostics.dot rename to libs/ui_tests/reflection/type_alias_are_supported/expectations/diagnostics.dot diff --git a/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/stderr.txt b/libs/ui_tests/reflection/type_alias_are_supported/expectations/stderr.txt similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/expectations/stderr.txt rename to libs/ui_tests/reflection/type_alias_are_supported/expectations/stderr.txt diff --git a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml new file mode 100644 index 000000000..79599516a --- /dev/null +++ b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "application_f8f62968" +version = "0.1.0" +edition = "2021" + +[package.metadata.px.generate] +generator_type = "cargo_workspace_binary" +generator_name = "app" + +[dependencies] +app_f8f62968 = { version = "0.1.0", path = ".." } +dep_f8f62968 = { version = "0.1.0", path = "../ephemeral_deps/dep" } +http = "1.1.0" +hyper = "1.4.1" +pavex = { version = "0.1.48", path = "../../../../pavex" } +pavex_matchit = "0.7.4" +thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/blueprint.ron new file mode 100644 index 000000000..130595f60 --- /dev/null +++ b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/blueprint.ron @@ -0,0 +1,70 @@ +( + creation_location: ( + line: 19, + column: 18, + file: "reflection/type_alias_are_supported/src/lib.rs", + ), + components: [ + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_f8f62968", + module_path: "app_f8f62968", + ), + import_path: "crate::constructor_with_output_tuple", + ), + location: ( + line: 20, + column: 8, + file: "reflection/type_alias_are_supported/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Constructor(( + constructor: ( + callable: ( + registered_at: ( + crate_name: "app_f8f62968", + module_path: "app_f8f62968", + ), + import_path: "crate::RemoteAlias::new", + ), + location: ( + line: 24, + column: 8, + file: "reflection/type_alias_are_supported/src/lib.rs", + ), + ), + lifecycle: Singleton, + cloning_strategy: None, + error_handler: None, + lints: {}, + )), + Route(( + path: "/home", + method_guard: Some([ + "GET", + ]), + request_handler: ( + callable: ( + registered_at: ( + crate_name: "app_f8f62968", + module_path: "app_f8f62968", + ), + import_path: "crate::handler_with_input_tuple", + ), + location: ( + line: 25, + column: 8, + file: "reflection/type_alias_are_supported/src/lib.rs", + ), + ), + error_handler: None, + )), + ], +) \ No newline at end of file diff --git a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/src/lib.rs new file mode 100644 index 000000000..718bec825 --- /dev/null +++ b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/src/lib.rs @@ -0,0 +1,181 @@ +//! 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, + application_state: ApplicationState, +} +pub struct ApplicationState { + s0: (bool, char, u8), + s1: dep_f8f62968::ActualType, +} +pub async fn build_application_state() -> crate::ApplicationState { + let v0 = app_f8f62968::RemoteAlias::new(); + let v1 = app_f8f62968::constructor_with_output_tuple(); + crate::ApplicationState { + s0: v1, + s1: v0, + } +} +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("/home", 0u32).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_1::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::GET => { + route_0::entrypoint( + server_state.application_state.s0.clone(), + &server_state.application_state.s1, + ) + .await + } + _ => { + let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ + pavex::http::Method::GET, + ]) + .into(); + route_1::entrypoint(&allowed_methods).await + } + } + } + i => unreachable!("Unknown route id: {}", i), + } +} +pub mod route_0 { + pub async fn entrypoint<'a>( + s_0: (bool, char, u8), + s_1: &'a dep_f8f62968::ActualType, + ) -> pavex::response::Response { + let response = wrapping_0(s_0, s_1).await; + response + } + async fn stage_1<'a>( + s_0: (bool, char, u8), + s_1: &'a dep_f8f62968::ActualType, + ) -> pavex::response::Response { + let response = handler(s_0, s_1).await; + response + } + async fn wrapping_0( + v0: (bool, char, u8), + v1: &dep_f8f62968::ActualType, + ) -> pavex::response::Response { + let v2 = crate::route_0::Next0 { + s_0: v0, + s_1: v1, + next: stage_1, + }; + let v3 = pavex::middleware::Next::new(v2); + let v4 = pavex::middleware::wrap_noop(v3).await; + ::into_response(v4) + } + async fn handler( + v0: (bool, char, u8), + v1: &dep_f8f62968::ActualType, + ) -> pavex::response::Response { + let v2 = app_f8f62968::handler_with_input_tuple(v0, v1); + ::into_response(v2) + } + struct Next0<'a, T> + where + T: std::future::Future, + { + s_0: (bool, char, u8), + s_1: &'a dep_f8f62968::ActualType, + next: fn((bool, char, u8), &'a dep_f8f62968::ActualType) -> 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, self.s_1) + } + } +} +pub mod route_1 { + 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_1::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) + } + } +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/lib.rs b/libs/ui_tests/reflection/type_alias_are_supported/src/lib.rs similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/lib.rs rename to libs/ui_tests/reflection/type_alias_are_supported/src/lib.rs diff --git a/libs/ui_tests/reflection/type_alias_are_supported/src/main.rs b/libs/ui_tests/reflection/type_alias_are_supported/src/main.rs new file mode 100644 index 000000000..4d960d93e --- /dev/null +++ b/libs/ui_tests/reflection/type_alias_are_supported/src/main.rs @@ -0,0 +1,24 @@ +//! This code is generated by `pavex_test_runner`, +//! Do NOT modify it manually. +use app_f8f62968::blueprint; +use pavex_cli_client::{Client, config::Color}; +use pavex_cli_client::commands::generate::GenerateError; + +fn main() -> Result<(), Box> { + let ui_test_dir: std::path::PathBuf = std::env::var("UI_TEST_DIR").unwrap().into(); + let outcome = Client::new() + .color(Color::Always) + .pavex_cli_path(std::env::var("PAVEX_TEST_CLI_PATH").unwrap().into()) + .generate(blueprint(), ui_test_dir.join("generated_app")) + .diagnostics_path("diagnostics.dot".into()) + .execute(); + match outcome { + Ok(_) => {}, + Err(GenerateError::NonZeroExitCode(_)) => { std::process::exit(1); } + Err(e) => { + eprintln!("Failed to invoke `pavex generate`.\n{:?}", e); + std::process::exit(1); + } + } + Ok(()) +} diff --git a/libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/test_config.toml b/libs/ui_tests/reflection/type_alias_are_supported/test_config.toml similarity index 100% rename from libs/pavex_cli/tests/ui_tests/reflection/type_alias_are_supported/test_config.toml rename to libs/ui_tests/reflection/type_alias_are_supported/test_config.toml diff --git a/libs/ui_tests/workspace_hack/.gitattributes b/libs/ui_tests/workspace_hack/.gitattributes new file mode 100644 index 000000000..3e9dba4b6 --- /dev/null +++ b/libs/ui_tests/workspace_hack/.gitattributes @@ -0,0 +1,4 @@ +# Avoid putting conflict markers in the generated Cargo.toml file, since their presence breaks +# Cargo. +# Also do not check out the file as CRLF on Windows, as that's what hakari needs. +Cargo.toml merge=binary -crlf diff --git a/libs/ui_tests/workspace_hack/Cargo.toml b/libs/ui_tests/workspace_hack/Cargo.toml new file mode 100644 index 000000000..e7f1f41a1 --- /dev/null +++ b/libs/ui_tests/workspace_hack/Cargo.toml @@ -0,0 +1,48 @@ +# This file is generated by `cargo hakari`. +# To regenerate, run: +# cargo hakari generate + +[package] +name = "workspace_hack" +version = "0.1.0" +description = "workspace-hack package, managed by hakari" +# You can choose to publish this crate: see https://docs.rs/cargo-hakari/latest/cargo_hakari/publishing. +publish = false + +# The parts of the file between the BEGIN HAKARI SECTION and END HAKARI SECTION comments +# are managed by hakari. + +### BEGIN HAKARI SECTION +[dependencies] +futures-channel = { version = "0.3", features = ["sink"] } +futures-core = { version = "0.3" } +futures-sink = { version = "0.3" } +futures-task = { version = "0.3", default-features = false, features = ["std"] } +futures-util = { version = "0.3", features = ["channel", "io", "sink"] } +memchr = { version = "2" } +proc-macro2 = { version = "1", features = ["span-locations"] } +quote = { version = "1" } +reqwest = { version = "0.12", features = ["json", "rustls-tls"] } +serde = { version = "1", features = ["alloc", "derive"] } +serde_json = { version = "1", features = ["unbounded_depth"] } +smallvec = { version = "1", default-features = false, features = ["const_new"] } +syn = { version = "2", features = ["extra-traits", "full", "visit", "visit-mut"] } +tokio = { version = "1", features = ["full"] } + +[build-dependencies] +futures-channel = { version = "0.3", features = ["sink"] } +futures-core = { version = "0.3" } +futures-sink = { version = "0.3" } +futures-task = { version = "0.3", default-features = false, features = ["std"] } +futures-util = { version = "0.3", features = ["channel", "io", "sink"] } +memchr = { version = "2" } +proc-macro2 = { version = "1", features = ["span-locations"] } +quote = { version = "1" } +reqwest = { version = "0.12", features = ["json", "rustls-tls"] } +serde = { version = "1", features = ["alloc", "derive"] } +serde_json = { version = "1", features = ["unbounded_depth"] } +smallvec = { version = "1", default-features = false, features = ["const_new"] } +syn = { version = "2", features = ["extra-traits", "full", "visit", "visit-mut"] } +tokio = { version = "1", features = ["full"] } + +### END HAKARI SECTION diff --git a/libs/ui_tests/workspace_hack/build.rs b/libs/ui_tests/workspace_hack/build.rs new file mode 100644 index 000000000..92518ef04 --- /dev/null +++ b/libs/ui_tests/workspace_hack/build.rs @@ -0,0 +1,2 @@ +// A build script is required for cargo to consider build dependencies. +fn main() {} diff --git a/libs/ui_tests/workspace_hack/src/lib.rs b/libs/ui_tests/workspace_hack/src/lib.rs new file mode 100644 index 000000000..22489f632 --- /dev/null +++ b/libs/ui_tests/workspace_hack/src/lib.rs @@ -0,0 +1 @@ +// This is a stub lib.rs. From 566686a28566c9484132ad1835e543dadcf9b53f Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:23:47 +0200 Subject: [PATCH 09/16] Use Unix separators in Cargo.toml --- libs/pavex_test_runner/src/lib.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/pavex_test_runner/src/lib.rs b/libs/pavex_test_runner/src/lib.rs index d8e80b518..9b20afb55 100644 --- a/libs/pavex_test_runner/src/lib.rs +++ b/libs/pavex_test_runner/src/lib.rs @@ -419,7 +419,16 @@ fn create_tests_dir( for test_data in test_name2test_data.values() { for member in test_data.workspace_members() { let relative_path = member.strip_prefix(&runtime_directory).unwrap(); - writeln!(cargo_toml, " \"{}\",", relative_path.display()).unwrap(); + // We use the Unix path separator, since that's what `cargo` expects + // in `Cargo.toml` files. + let p = relative_path + .components() + .map(|c| match c { + std::path::Component::Normal(s) => s.to_string_lossy(), + _ => unreachable!(), + }) + .join("/"); + writeln!(cargo_toml, " \"{p}\",").unwrap(); } } writeln!(&mut cargo_toml, "]").unwrap(); From 8e8444e77a4c0b7df85fc01af2eaacf6c658b884 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:13:33 +0200 Subject: [PATCH 10/16] Polish --- libs/pavex_test_runner/src/lib.rs | 233 +- libs/ui_tests/Cargo.lock | 2500 ++++++++++++++++- libs/ui_tests/Cargo.toml | 285 ++ .../app_builder/generated_app/Cargo.toml | 8 - .../app_builder/generated_app/src/lib.rs | 196 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 179 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 407 --- .../generated_app/Cargo.toml | 7 - .../generated_app/src/lib.rs | 101 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 204 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 158 -- .../generated_app/Cargo.toml | 9 - .../generated_app/src/lib.rs | 153 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 153 - .../generated_app/Cargo.toml | 7 - .../generated_app/src/lib.rs | 101 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 230 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 219 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 155 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 207 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 166 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 168 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 158 -- .../prebuilt_works/generated_app/Cargo.toml | 8 - .../prebuilt_works/generated_app/src/lib.rs | 207 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 181 -- .../unused_prebuilt/generated_app/Cargo.toml | 7 - .../unused_prebuilt/generated_app/src/lib.rs | 101 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 269 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 831 ------ .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 153 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 166 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 156 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 157 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 168 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 161 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 156 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 155 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 167 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 160 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 155 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 154 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 219 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 150 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 166 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 237 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 289 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 161 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 261 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 164 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 166 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 190 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 170 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 652 ----- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 230 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 235 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 254 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 326 --- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 152 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 166 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 307 -- .../generated_app/Cargo.toml | 9 - .../generated_app/src/lib.rs | 155 - .../generated_app/Cargo.toml | 10 - .../generated_app/src/lib.rs | 154 - .../generated_app/Cargo.toml | 10 - .../generated_app/src/lib.rs | 154 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 153 - .../generated_app/Cargo.toml | 9 - .../generated_app/src/lib.rs | 154 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 230 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 152 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 166 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 160 -- .../generated_app/Cargo.toml | 9 - .../generated_app/src/lib.rs | 166 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 153 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 153 - .../generated_app/Cargo.toml | 9 - .../generated_app/src/lib.rs | 164 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 152 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 165 -- .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 156 - .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 158 -- .../generated_app/Cargo.toml | 9 - .../generated_app/src/lib.rs | 181 -- 143 files changed, 2728 insertions(+), 14730 deletions(-) diff --git a/libs/pavex_test_runner/src/lib.rs b/libs/pavex_test_runner/src/lib.rs index 9b20afb55..ed2450e70 100644 --- a/libs/pavex_test_runner/src/lib.rs +++ b/libs/pavex_test_runner/src/lib.rs @@ -3,7 +3,7 @@ use std::fmt::Write; use std::path::{Component, Path, PathBuf}; use std::process::{Command, Output}; -use ahash::{HashMap, HashSet}; +use ahash::HashSet; use anyhow::Context; use cargo_metadata::diagnostic::DiagnosticLevel; use console::style; @@ -68,20 +68,33 @@ pub fn run_tests( for entry in get_ui_test_directories(&tests_directory) { let test_name = get_test_name(&tests_directory, &entry); let test_data = TestData::new(&test_name, entry.clone())?; - if is_filtered_out(&arguments, &test_name) || test_data.configuration.ignore { - continue; - } test_name2test_data.insert(test_name, test_data); } create_tests_dir(&tests_directory, &test_name2test_data)?; + let test_name2test_data = test_name2test_data + .into_iter() + .filter(|(test_name, test_data)| { + // Skip tests that are filtered out (e.g. by name or by tag) + // We only do this *after* we've created the test directories, so that we don't + // change the test directory structure based on the filters, which would cause + // cache invalidation issues for `cargo`. + !is_filtered_out(&arguments, &test_name) && !test_data.configuration.ignore + }) + .collect::>(); + let mut trials = Vec::with_capacity(test_name2test_data.len() * 4); if !arguments.list { - warm_up_rustdoc_cache(&tests_directory, &test_name2test_data)?; warm_up_target_dir(&tests_directory, &test_name2test_data)?; + // We warm up Pavex's `rustdoc` cache to avoid cross-test contention. + // In case of a cache miss, a UI test will try to run `rustdoc` and + // acquire the global target directory lock. If multiple tests end up + // doing this at the same time, their execution will be serialized, + // which would have a major impact on the overall test suite runtime. + warm_up_rustdoc_cache(&tests_directory, &test_name2test_data)?; - // First battery of the UI tests. + // First battery of UI tests. // For each UI test, we run code generation and then generate a different // "test case" for each assertion that's relevant to the code generation process. // If all assertions pass, we return a `bool` set to `true` which indicates @@ -90,6 +103,8 @@ pub fn run_tests( let timer = std::time::Instant::now(); println!("Performing code generation for {n_codegen_tests} tests"); let intermediate: BTreeMap, bool)> = test_name2test_data + // This defaults to the number of logical cores on the machine. + // TODO: honor the `--jobs` flag from `cargo test`. .par_iter() .map(|(name, data)| { let mut trials = Vec::new(); @@ -142,11 +157,11 @@ pub fn run_tests( trials.extend(cases); - // TODO: We need to run them in parallel. let test_name2test_data: BTreeMap<_, _> = test_name2test_data .into_iter() .filter(|(_, data)| data.should_run_tests()) .collect(); + build_integration_tests(&tests_directory, &test_name2test_data); let n_integration_cases = test_name2test_data.len(); println!("Running integration tests for {n_integration_cases} test cases"); let timer = std::time::Instant::now(); @@ -195,42 +210,45 @@ fn compile_generated_apps( let build_output = CommandOutput::try_from(&output).context("Failed to parse build output")?; let mut crate_names2error = BTreeMap::<_, String>::new(); for line in build_output.stderr.lines() { - let Ok(json) = serde_json::from_str::(line) else { + let Ok(cargo_metadata::Message::CompilerMessage(msg)) = + serde_json::from_str::(line) + else { // Not all output lines are JSON, so we ignore the ones that aren't. + // We also ignore other types of messages (e.g. build scripts notifications + // and artifact information). continue; }; - // We are primarily looking for errors here. - let cargo_metadata::Message::CompilerMessage(msg) = json else { - continue; - }; - if msg.message.level == DiagnosticLevel::Error - || msg.message.level == DiagnosticLevel::FailureNote + // We are only looking at errors here. + if !(msg.message.level == DiagnosticLevel::Error + || msg.message.level == DiagnosticLevel::FailureNote) { - let package_name_and_version = msg - .package_id - .repr - .split_once('#') - .expect("Missing package name") - .1; - let package_name = package_name_and_version - .split_once('@') - .expect("Missing version") - .0; - assert!( - generated_crate_names.contains(package_name), - "Error compiling a crate that's not one of ours, {}", - msg.package_id.repr - ); - let errors = crate_names2error - .entry(package_name.to_owned()) - .or_default(); - writeln!( - errors, - "{}", - msg.message.rendered.unwrap_or(msg.message.message) - ) - .unwrap(); + continue; } + + let package_name_and_version = msg + .package_id + .repr + .split_once('#') + .expect("Missing package name") + .1; + let package_name = package_name_and_version + .split_once('@') + .expect("Missing version") + .0; + assert!( + generated_crate_names.contains(package_name), + "Error compiling a crate that's not one of ours, {}", + msg.package_id.repr + ); + let errors = crate_names2error + .entry(package_name.to_owned()) + .or_default(); + writeln!( + errors, + "{}", + msg.message.rendered.unwrap_or(msg.message.message) + ) + .unwrap(); } let mut trials = Vec::new(); let mut further = BTreeMap::new(); @@ -287,49 +305,6 @@ fn warm_up_target_dir( runtime_directory: &Path, test_name2test_data: &BTreeMap, ) -> Result<(), anyhow::Error> { - println!("Creating a workspace-hack crate to unify dependencies"); - - // Clean up pre-existing workspace_hack, since `cargo hakari init` will fail - // if it already exists. - // let _ = fs_err::remove_dir_all(runtime_directory.join("workspace_hack")); - // let _ = fs_err::remove_file(runtime_directory.join(".config").join("hakari.toml")); - - // let mut cmd = Command::new("cargo"); - // cmd.arg("hakari") - // .arg("init") - // .arg("-y") - // .arg("workspace_hack") - // .current_dir(runtime_directory) - // .stdout(std::process::Stdio::inherit()) - // .stderr(std::process::Stdio::inherit()); - // let status = cmd.status()?; - // if !status.success() { - // anyhow::bail!("Failed to create workspace_hack crate"); - // } - - // let mut cmd = Command::new("cargo"); - // cmd.arg("hakari") - // .arg("generate") - // .current_dir(runtime_directory) - // .stdout(std::process::Stdio::inherit()) - // .stderr(std::process::Stdio::inherit()); - // let status = cmd.status()?; - // if !status.success() { - // anyhow::bail!("Failed to generate workspace_hack crate"); - // } - - // let mut cmd = Command::new("cargo"); - // cmd.arg("hakari") - // .arg("manage-deps") - // .arg("-y") - // .current_dir(runtime_directory) - // .stdout(std::process::Stdio::inherit()) - // .stderr(std::process::Stdio::inherit()); - // let status = cmd.status()?; - // if !status.success() { - // anyhow::bail!("Failed to manage workspace_hack dependencies"); - // } - let timer = std::time::Instant::now(); println!("Warming up the target directory"); let mut cmd = Command::new("cargo"); @@ -369,16 +344,23 @@ fn warm_up_rustdoc_cache( DEFAULT_DOCS_TOOLCHAIN.to_owned(), runtime_directory.to_path_buf(), )?; - let mut crates = test_name2test_data + let app_names = test_name2test_data .values() - .flat_map(|data| { - data.configuration - .ephemeral_dependencies - .keys() - .map(|name| format!("{name}_{}", data.name_hash)) - .chain(std::iter::once(format!("app_{}", data.name_hash))) - }) + .map(|data| data.blueprint_crate_name()) .collect::>(); + let mut crates: HashSet<_> = crate_collection + .package_graph() + .workspace() + .iter() + .filter(|p| { + !(p.name().starts_with("application_") + || p.name().starts_with("integration_") + || p.name() == "workspace_hack" + || (p.name().starts_with("app_") && !app_names.contains(p.name()))) + }) + .map(|p| p.name().to_owned()) + .collect(); + crates.remove("workspace_hack"); // Hand-picked crates that we know we're going to build docs for. crates.insert("pavex".into()); crates.insert("tracing".into()); @@ -414,8 +396,10 @@ fn create_tests_dir( // Create a `Cargo.toml` to define a workspace, // where each UI test is a workspace member let cargo_toml_path = runtime_directory.join("Cargo.toml"); - let mut cargo_toml = String::new(); - writeln!(&mut cargo_toml, "[workspace]\nmembers = [").unwrap(); + let mut cargo_toml = r##"# Generated by `pavex_test_runner`. +# Do NOT modify it manually."## + .to_string(); + writeln!(&mut cargo_toml, "\n[workspace]\nmembers = [").unwrap(); for test_data in test_name2test_data.values() { for member in test_data.workspace_members() { let relative_path = member.strip_prefix(&runtime_directory).unwrap(); @@ -477,44 +461,11 @@ struct TestConfig { /// Define what we expect to see when running the tests (e.g. should code generation succeed or fail?). #[serde(default)] expectations: TestExpectations, - /// Ephemeral crates that should be generated as part of the test setup in order to be - /// used as dependencies of the main crate under test. - #[serde(default)] - ephemeral_dependencies: HashMap, - /// Crates that should be listed as dependencies of the package under the test, in addition to - /// Pavex itself. - #[serde(default)] - dependencies: toml::value::Table, - /// Crates that should be listed as dev dependencies of the test package. - #[serde(default, rename = "dev-dependencies")] - dev_dependencies: toml::value::Table, /// Ignore the test if set to `true`. #[serde(default)] ignore: bool, } -#[derive(serde::Deserialize)] -#[serde(rename_all = "snake_case")] -struct EphemeralDependency { - #[serde(default)] - /// The name of the package in the generated `Cargo.toml`. - /// If not specified, the corresponding key in [`TestConfig::ephemeral_dependencies`] will be used. - package: Option, - /// The path to the file that should be used as `lib.rs` in the generated library crate. - path: PathBuf, - /// Crates that should be listed as dependencies of generated library crate. - #[serde(default)] - dependencies: toml::value::Table, - #[serde(default = "default_ephemeral_version")] - /// The version of the package in the generated `Cargo.toml`. - /// If not specified, it defaults to `0.1.0`. - version: String, -} - -fn default_ephemeral_version() -> String { - "0.1.0".to_string() -} - #[derive(serde::Deserialize)] #[serde(rename_all = "snake_case")] struct TestExpectations { @@ -608,15 +559,6 @@ impl TestData { }) } - /// The directory containing the source code of all ephemeral dependencies. - /// - /// We don't want to list ephemeral dependencies as members of the workspace of the project under test - /// in order to be able to have multiple versions of the same crate as dependencies of the project under test. - /// That would be forbidden by `cargo` if they were listed as members of the same workspace. - fn ephemeral_deps_directory(&self) -> PathBuf { - self.definition_directory.join("ephemeral_deps") - } - fn blueprint_directory(&self) -> &Path { &self.definition_directory } @@ -894,12 +836,33 @@ fn application_code_test(test_name: &str, test: &TestData) -> Trial { } } +fn build_integration_tests(test_dir: &Path, test_name2test_data: &BTreeMap) { + let n_integration_tests = test_name2test_data.len(); + let timer = std::time::Instant::now(); + println!("Building {n_integration_tests} integration tests, without running them"); + let mut cmd = std::process::Command::new("cargo"); + cmd.arg("test").arg("--no-run"); + for test in test_name2test_data.values() { + cmd.arg("-p").arg(format!("integration_{}", test.name_hash)); + } + + // We don't care if it fails, since we are going to capture failures + // one test at a time when we run them. + let _ = cmd + .current_dir(test_dir) + .stdout(std::process::Stdio::inherit()) + .stderr(std::process::Stdio::inherit()) + .output(); + println!( + "Built {n_integration_tests} integration tests in {} seconds", + timer.elapsed().as_secs() + ); +} + fn application_integration_test(test: &TestData) -> Result<(), anyhow::Error> { let output = std::process::Command::new("cargo") // .env("RUSTFLAGS", "-Awarnings") .arg("t") - // .arg("--jobs") - // .arg("1") .arg("-p") .arg(format!("integration_{}", test.name_hash)) .current_dir(&test.definition_directory) diff --git a/libs/ui_tests/Cargo.lock b/libs/ui_tests/Cargo.lock index 6522dd83e..2b1d09464 100644 --- a/libs/ui_tests/Cargo.lock +++ b/libs/ui_tests/Cargo.lock @@ -126,32 +126,1851 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" + +[[package]] +name = "app_00ed62be" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_01492b3d" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_01bbcc3d" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_028e5d85" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_05806dea" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_065fd341" +version = "0.1.0" +dependencies = [ + "dep_065fd341", + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_0ca8edfa" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_0cb36ccc" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_11354b55" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_18d45c43" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_1bd0738c" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_23e2eec5" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_24452d94" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_2480aa2b" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_24d12820" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_2546f91e" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_30248169" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_309371bf" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_335ca652" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_33cee83d" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_366b29bf" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_381916a7" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_39415e2f" +version = "0.1.0" +dependencies = [ + "dep_39415e2f", + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_3acfbc8e" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_3e2693d0" +version = "0.1.0" +dependencies = [ + "dep_3e2693d0", + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_3e90eeee" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_3fac62e4" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_40a0f751" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_40ab089d" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_40e90d31" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_41064ffa" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_466ed127" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_46ab7f5d" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_46e3d1f1" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_4a62f10c" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_4b6f5359" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_4bcfa44d" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_4c9069e8" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_51ea2925" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_53427e7d" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_53b2f5d8" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "serde", + "workspace_hack", +] [[package]] name = "app_55dca802" version = "0.1.0" -dependencies = [ - "dep_55dca802", - "pavex", - "pavex_cli_client", - "workspace_hack", -] +dependencies = [ + "dep_55dca802", + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_56692d2c" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_56967fe8" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_59d05850" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_5f6d02ba" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_603d81dd" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_621e9d53" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_67306117" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_698936eb" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_6b4ffaf2" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_6c44cec0" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_6e40e01f" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_700defb2" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_7321b637" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_7479eeb2" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_74f21254" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_75542b02" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_776ff188" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_78452ff2" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_7c78acb2" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_802eb683" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_812a13f2" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_821d919e" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_835fd2b1" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_88bca0dc" +version = "0.1.0" +dependencies = [ + "bytes 1.7.2", + "http 1.1.0", + "http-body 1.0.1", + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_8ac65a81" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_8b5f0867" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_8b77b4be" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_8ce66b53" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_8e8ba674" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_8ee91948" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_900c9672" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_90734139" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_91e1ac20" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_933292bd" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_951b7f8d" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_9717f587" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_9adade88" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_9b6ffdef" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_9d0a5748" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_9fbe7a0c" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_a0da5eb4" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_a0f4586a" +version = "0.1.0" +dependencies = [ + "dep_a0f4586a", + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_a1f930e1" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_a442c90a" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_a6a2e116" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_a7783cd8" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_a7fd6a2c" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ae32f1c9" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_af31d59e" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_b02b0728" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_b3516518" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ba0e5d33" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_c1ac8ad4" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "serde", + "workspace_hack", +] + +[[package]] +name = "app_c266691d" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_c2e83ed5" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_c3c254cf" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_c51a0844" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "serde", + "workspace_hack", +] + +[[package]] +name = "app_c5885cdb" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_c62eca9e" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_c7a5ef25" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_c8000fe9" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ca08c5dd" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ca963e92" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "reqwest 0.11.27", + "workspace_hack", +] + +[[package]] +name = "app_cb7427d1" +version = "0.1.0" +dependencies = [ + "http 0.1.21", + "http 0.2.12", + "hyper 0.14.30", + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ce0a2170" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_d0f81bc0" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_d1b695a6" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_d238c5d8" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_d24e80c4" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_d2e8db7a" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_d408236b" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_d50c6d0c" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_d56c0f9d" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_d89d2d61" +version = "0.1.0" +dependencies = [ + "anyhow", + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_db1cbdff" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_dc1710a5" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_dcb9931d" +version = "0.1.0" +dependencies = [ + "bytes 1.7.2", + "dep_dcb9931d", + "hyper 1.4.1", + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ddc3d7f1" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_de592621" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_e1c9a48c" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_e31b3bf3" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_e4a8214b" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_e501823b" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "thiserror", + "workspace_hack", +] + +[[package]] +name = "app_e5e761b9" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_e628417e" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "tokio", + "workspace_hack", +] + +[[package]] +name = "app_e6a3fe43" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_e8f51606" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ea86e18a" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ea979460" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ebc534c7" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ec0f16d1" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ecefbcb0" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_ee506b88" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_f10df8fa" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_f1383503" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_f6a54ba5" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_f8f62968" +version = "0.1.0" +dependencies = [ + "dep_f8f62968", + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "app_fc852cc3" +version = "0.1.0" +dependencies = [ + "pavex", + "pavex_cli_client", + "workspace_hack", +] + +[[package]] +name = "application_00ed62be" +version = "0.1.0" + +[[package]] +name = "application_01492b3d" +version = "0.1.0" + +[[package]] +name = "application_01bbcc3d" +version = "0.1.0" + +[[package]] +name = "application_028e5d85" +version = "0.1.0" + +[[package]] +name = "application_05806dea" +version = "0.1.0" + +[[package]] +name = "application_065fd341" +version = "0.1.0" + +[[package]] +name = "application_0ca8edfa" +version = "0.1.0" + +[[package]] +name = "application_0cb36ccc" +version = "0.1.0" + +[[package]] +name = "application_11354b55" +version = "0.1.0" + +[[package]] +name = "application_18d45c43" +version = "0.1.0" + +[[package]] +name = "application_1bd0738c" +version = "0.1.0" + +[[package]] +name = "application_23e2eec5" +version = "0.1.0" + +[[package]] +name = "application_24452d94" +version = "0.1.0" + +[[package]] +name = "application_2480aa2b" +version = "0.1.0" + +[[package]] +name = "application_24d12820" +version = "0.1.0" + +[[package]] +name = "application_2546f91e" +version = "0.1.0" + +[[package]] +name = "application_30248169" +version = "0.1.0" + +[[package]] +name = "application_309371bf" +version = "0.1.0" + +[[package]] +name = "application_335ca652" +version = "0.1.0" + +[[package]] +name = "application_33cee83d" +version = "0.1.0" + +[[package]] +name = "application_366b29bf" +version = "0.1.0" + +[[package]] +name = "application_381916a7" +version = "0.1.0" + +[[package]] +name = "application_39415e2f" +version = "0.1.0" + +[[package]] +name = "application_3acfbc8e" +version = "0.1.0" + +[[package]] +name = "application_3e2693d0" +version = "0.1.0" + +[[package]] +name = "application_3e90eeee" +version = "0.1.0" + +[[package]] +name = "application_3fac62e4" +version = "0.1.0" + +[[package]] +name = "application_40a0f751" +version = "0.1.0" + +[[package]] +name = "application_40ab089d" +version = "0.1.0" + +[[package]] +name = "application_40e90d31" +version = "0.1.0" + +[[package]] +name = "application_41064ffa" +version = "0.1.0" + +[[package]] +name = "application_466ed127" +version = "0.1.0" + +[[package]] +name = "application_46ab7f5d" +version = "0.1.0" + +[[package]] +name = "application_46e3d1f1" +version = "0.1.0" + +[[package]] +name = "application_4a62f10c" +version = "0.1.0" + +[[package]] +name = "application_4b6f5359" +version = "0.1.0" + +[[package]] +name = "application_4bcfa44d" +version = "0.1.0" + +[[package]] +name = "application_4c9069e8" +version = "0.1.0" + +[[package]] +name = "application_51ea2925" +version = "0.1.0" + +[[package]] +name = "application_53427e7d" +version = "0.1.0" + +[[package]] +name = "application_53b2f5d8" +version = "0.1.0" + +[[package]] +name = "application_55dca802" +version = "0.1.0" + +[[package]] +name = "application_56692d2c" +version = "0.1.0" + +[[package]] +name = "application_56967fe8" +version = "0.1.0" + +[[package]] +name = "application_59d05850" +version = "0.1.0" + +[[package]] +name = "application_5f6d02ba" +version = "0.1.0" + +[[package]] +name = "application_603d81dd" +version = "0.1.0" + +[[package]] +name = "application_621e9d53" +version = "0.1.0" + +[[package]] +name = "application_67306117" +version = "0.1.0" + +[[package]] +name = "application_698936eb" +version = "0.1.0" + +[[package]] +name = "application_6b4ffaf2" +version = "0.1.0" + +[[package]] +name = "application_6c44cec0" +version = "0.1.0" + +[[package]] +name = "application_6e40e01f" +version = "0.1.0" + +[[package]] +name = "application_700defb2" +version = "0.1.0" + +[[package]] +name = "application_7321b637" +version = "0.1.0" + +[[package]] +name = "application_7479eeb2" +version = "0.1.0" + +[[package]] +name = "application_74f21254" +version = "0.1.0" + +[[package]] +name = "application_75542b02" +version = "0.1.0" + +[[package]] +name = "application_776ff188" +version = "0.1.0" + +[[package]] +name = "application_78452ff2" +version = "0.1.0" + +[[package]] +name = "application_7c78acb2" +version = "0.1.0" + +[[package]] +name = "application_802eb683" +version = "0.1.0" + +[[package]] +name = "application_812a13f2" +version = "0.1.0" + +[[package]] +name = "application_821d919e" +version = "0.1.0" + +[[package]] +name = "application_835fd2b1" +version = "0.1.0" + +[[package]] +name = "application_88bca0dc" +version = "0.1.0" + +[[package]] +name = "application_8ac65a81" +version = "0.1.0" + +[[package]] +name = "application_8b5f0867" +version = "0.1.0" + +[[package]] +name = "application_8b77b4be" +version = "0.1.0" + +[[package]] +name = "application_8ce66b53" +version = "0.1.0" + +[[package]] +name = "application_8e8ba674" +version = "0.1.0" + +[[package]] +name = "application_8ee91948" +version = "0.1.0" + +[[package]] +name = "application_900c9672" +version = "0.1.0" + +[[package]] +name = "application_90734139" +version = "0.1.0" + +[[package]] +name = "application_91e1ac20" +version = "0.1.0" + +[[package]] +name = "application_933292bd" +version = "0.1.0" + +[[package]] +name = "application_951b7f8d" +version = "0.1.0" + +[[package]] +name = "application_9717f587" +version = "0.1.0" + +[[package]] +name = "application_9adade88" +version = "0.1.0" [[package]] -name = "application_55dca802" +name = "application_9b6ffdef" +version = "0.1.0" + +[[package]] +name = "application_9d0a5748" +version = "0.1.0" + +[[package]] +name = "application_9fbe7a0c" +version = "0.1.0" + +[[package]] +name = "application_a0da5eb4" +version = "0.1.0" + +[[package]] +name = "application_a0f4586a" +version = "0.1.0" + +[[package]] +name = "application_a1f930e1" +version = "0.1.0" + +[[package]] +name = "application_a442c90a" +version = "0.1.0" + +[[package]] +name = "application_a6a2e116" +version = "0.1.0" + +[[package]] +name = "application_a7783cd8" +version = "0.1.0" + +[[package]] +name = "application_a7fd6a2c" +version = "0.1.0" + +[[package]] +name = "application_ae32f1c9" +version = "0.1.0" + +[[package]] +name = "application_af31d59e" +version = "0.1.0" + +[[package]] +name = "application_b02b0728" +version = "0.1.0" + +[[package]] +name = "application_b3516518" +version = "0.1.0" + +[[package]] +name = "application_ba0e5d33" +version = "0.1.0" + +[[package]] +name = "application_c1ac8ad4" +version = "0.1.0" + +[[package]] +name = "application_c266691d" +version = "0.1.0" + +[[package]] +name = "application_c2e83ed5" +version = "0.1.0" + +[[package]] +name = "application_c3c254cf" +version = "0.1.0" + +[[package]] +name = "application_c51a0844" +version = "0.1.0" + +[[package]] +name = "application_c5885cdb" +version = "0.1.0" + +[[package]] +name = "application_c62eca9e" +version = "0.1.0" + +[[package]] +name = "application_c7a5ef25" +version = "0.1.0" + +[[package]] +name = "application_c8000fe9" +version = "0.1.0" + +[[package]] +name = "application_ca08c5dd" +version = "0.1.0" + +[[package]] +name = "application_ca963e92" +version = "0.1.0" + +[[package]] +name = "application_cb7427d1" +version = "0.1.0" + +[[package]] +name = "application_ce0a2170" +version = "0.1.0" + +[[package]] +name = "application_d0f81bc0" +version = "0.1.0" + +[[package]] +name = "application_d1b695a6" +version = "0.1.0" + +[[package]] +name = "application_d238c5d8" +version = "0.1.0" + +[[package]] +name = "application_d24e80c4" +version = "0.1.0" + +[[package]] +name = "application_d2e8db7a" +version = "0.1.0" + +[[package]] +name = "application_d408236b" +version = "0.1.0" + +[[package]] +name = "application_d50c6d0c" +version = "0.1.0" + +[[package]] +name = "application_d56c0f9d" +version = "0.1.0" + +[[package]] +name = "application_d89d2d61" +version = "0.1.0" + +[[package]] +name = "application_db1cbdff" +version = "0.1.0" + +[[package]] +name = "application_dc1710a5" +version = "0.1.0" + +[[package]] +name = "application_dcb9931d" +version = "0.1.0" + +[[package]] +name = "application_ddc3d7f1" +version = "0.1.0" + +[[package]] +name = "application_de592621" +version = "0.1.0" + +[[package]] +name = "application_e1c9a48c" +version = "0.1.0" + +[[package]] +name = "application_e31b3bf3" +version = "0.1.0" + +[[package]] +name = "application_e4a8214b" +version = "0.1.0" + +[[package]] +name = "application_e501823b" +version = "0.1.0" + +[[package]] +name = "application_e5e761b9" +version = "0.1.0" + +[[package]] +name = "application_e628417e" +version = "0.1.0" + +[[package]] +name = "application_e6a3fe43" +version = "0.1.0" + +[[package]] +name = "application_e8f51606" +version = "0.1.0" + +[[package]] +name = "application_ea86e18a" +version = "0.1.0" + +[[package]] +name = "application_ea979460" +version = "0.1.0" + +[[package]] +name = "application_ebc534c7" +version = "0.1.0" + +[[package]] +name = "application_ec0f16d1" +version = "0.1.0" + +[[package]] +name = "application_ecefbcb0" +version = "0.1.0" + +[[package]] +name = "application_ee506b88" +version = "0.1.0" + +[[package]] +name = "application_f10df8fa" +version = "0.1.0" + +[[package]] +name = "application_f1383503" +version = "0.1.0" + +[[package]] +name = "application_f6a54ba5" +version = "0.1.0" + +[[package]] +name = "application_f8f62968" +version = "0.1.0" + +[[package]] +name = "application_fc852cc3" version = "0.1.0" -dependencies = [ - "app_55dca802", - "dep_55dca802", - "http", - "hyper", - "pavex", - "pavex_matchit", - "thiserror", -] [[package]] name = "arrayvec" @@ -226,6 +2045,12 @@ dependencies = [ "time", ] +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.6.0" @@ -258,15 +2083,25 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +dependencies = [ + "byteorder", + "iovec", +] + +[[package]] +name = "bytes" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cc" -version = "1.1.18" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "jobserver", "libc", @@ -291,9 +2126,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -301,9 +2136,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", @@ -313,9 +2148,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", @@ -399,6 +2234,27 @@ dependencies = [ "cipher", ] +[[package]] +name = "dep_065fd341" +version = "0.1.0" +dependencies = [ + "pavex", +] + +[[package]] +name = "dep_39415e2f" +version = "0.1.0" +dependencies = [ + "pavex", +] + +[[package]] +name = "dep_3e2693d0" +version = "0.1.0" +dependencies = [ + "pavex", +] + [[package]] name = "dep_55dca802" version = "0.1.0" @@ -406,6 +2262,30 @@ dependencies = [ "pavex", ] +[[package]] +name = "dep_a0f4586a" +version = "0.1.0" +dependencies = [ + "http 0.1.21", + "http 0.2.12", + "hyper 0.14.30", + "pavex", +] + +[[package]] +name = "dep_dcb9931d" +version = "1.0.0" +dependencies = [ + "pavex", +] + +[[package]] +name = "dep_f8f62968" +version = "0.1.0" +dependencies = [ + "pavex", +] + [[package]] name = "deranged" version = "0.3.11" @@ -599,6 +2479,25 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes 1.7.2", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "h2" version = "0.4.6" @@ -606,11 +2505,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", - "bytes", + "bytes 1.7.2", "fnv", "futures-core", "futures-sink", - "http", + "http 1.1.0", "indexmap", "slab", "tokio", @@ -657,15 +2556,48 @@ dependencies = [ "digest", ] +[[package]] +name = "http" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" +dependencies = [ + "bytes 0.4.12", + "fnv", + "itoa 0.4.8", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes 1.7.2", + "fnv", + "itoa 1.0.11", +] + [[package]] name = "http" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ - "bytes", + "bytes 1.7.2", "fnv", - "itoa", + "itoa 1.0.11", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes 1.7.2", + "http 0.2.12", + "pin-project-lite", ] [[package]] @@ -674,8 +2606,8 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ - "bytes", - "http", + "bytes 1.7.2", + "http 1.1.0", ] [[package]] @@ -684,10 +2616,10 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ - "bytes", + "bytes 1.7.2", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", "pin-project-lite", ] @@ -703,21 +2635,45 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "hyper" +version = "0.14.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +dependencies = [ + "bytes 1.7.2", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa 1.0.11", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + [[package]] name = "hyper" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ - "bytes", + "bytes 1.7.2", "futures-channel", "futures-util", - "h2", - "http", - "http-body", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", "httparse", "httpdate", - "itoa", + "itoa 1.0.11", "pin-project-lite", "smallvec", "tokio", @@ -731,8 +2687,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", - "http", - "hyper", + "http 1.1.0", + "hyper 1.4.1", "hyper-util", "rustls", "rustls-pki-types", @@ -742,15 +2698,28 @@ dependencies = [ "webpki-roots", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes 1.7.2", + "hyper 0.14.30", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "hyper-tls" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ - "bytes", + "bytes 1.7.2", "http-body-util", - "hyper", + "hyper 1.4.1", "hyper-util", "native-tls", "tokio", @@ -760,20 +2729,19 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ - "bytes", + "bytes 1.7.2", "futures-channel", "futures-util", - "http", - "http-body", - "hyper", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] @@ -808,6 +2776,78 @@ dependencies = [ "generic-array", ] +[[package]] +name = "integration_56967fe8" +version = "0.1.0" +dependencies = [ + "app_56967fe8", + "application_56967fe8", + "http-body-util", + "hyper 1.4.1", + "hyper-util", + "pavex", + "reqwest 0.12.7", + "tokio", + "tracing-subscriber", +] + +[[package]] +name = "integration_78452ff2" +version = "0.1.0" +dependencies = [ + "app_78452ff2", + "application_78452ff2", + "pavex", + "reqwest 0.12.7", + "tokio", + "tracing-subscriber", +] + +[[package]] +name = "integration_a1f930e1" +version = "0.1.0" +dependencies = [ + "app_a1f930e1", + "application_a1f930e1", + "pavex", + "reqwest 0.12.7", + "tokio", + "tracing-subscriber", +] + +[[package]] +name = "integration_c1ac8ad4" +version = "0.1.0" +dependencies = [ + "app_c1ac8ad4", + "application_c1ac8ad4", + "pavex", + "reqwest 0.12.7", + "tokio", + "tracing-subscriber", +] + +[[package]] +name = "integration_e628417e" +version = "0.1.0" +dependencies = [ + "app_e628417e", + "application_e628417e", + "pavex", + "reqwest 0.12.7", + "tokio", + "tracing-subscriber", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + [[package]] name = "ipnet" version = "2.10.0" @@ -826,6 +2866,12 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + [[package]] name = "itoa" version = "1.0.11" @@ -858,9 +2904,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "linux-raw-sys" @@ -884,6 +2930,15 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "memchr" version = "2.7.4" @@ -965,6 +3020,16 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -1016,7 +3081,7 @@ version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -1054,6 +3119,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "owo-colors" version = "4.1.0" @@ -1095,13 +3166,13 @@ version = "0.1.48" dependencies = [ "anyhow", "biscotti", - "bytes", + "bytes 1.7.2", "fs-err", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", "http-body-util", - "hyper", + "hyper 1.4.1", "hyper-util", "indexmap", "mime", @@ -1200,26 +3271,6 @@ dependencies = [ "indexmap", ] -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "pin-project-lite" version = "0.2.14" @@ -1234,9 +3285,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "polyval" @@ -1280,7 +3331,7 @@ version = "0.1.0" dependencies = [ "ahash", "aho-corasick", - "bitflags", + "bitflags 2.6.0", "byteorder", "cc", "clap", @@ -1307,9 +3358,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "regex-automata", - "regex-syntax", - "reqwest", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", + "reqwest 0.12.7", "serde", "serde_json", "sha2", @@ -1335,7 +3386,7 @@ version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ - "bytes", + "bytes 1.7.2", "pin-project-lite", "quinn-proto", "quinn-udp", @@ -1353,7 +3404,7 @@ version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ - "bytes", + "bytes 1.7.2", "rand", "ring", "rustc-hash", @@ -1418,11 +3469,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "62871f2d65009c0256aed1b9cfeeb8ac272833c404e13d53d400cd0dad7a2ac0" dependencies = [ - "bitflags", + "bitflags 2.6.0", ] [[package]] @@ -1433,8 +3484,17 @@ checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -1445,15 +3505,61 @@ checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.4", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes 1.7.2", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", + "hyper-tls 0.5.0", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile 1.0.4", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration 0.5.1", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + [[package]] name = "reqwest" version = "0.12.7" @@ -1461,17 +3567,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64 0.22.1", - "bytes", + "bytes 1.7.2", "encoding_rs", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", "http-body-util", - "hyper", + "hyper 1.4.1", "hyper-rustls", - "hyper-tls", + "hyper-tls 0.6.0", "hyper-util", "ipnet", "js-sys", @@ -1483,13 +3589,13 @@ dependencies = [ "pin-project-lite", "quinn", "rustls", - "rustls-pemfile", + "rustls-pemfile 2.1.3", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", - "system-configuration", + "sync_wrapper 1.0.1", + "system-configuration 0.6.1", "tokio", "tokio-native-tls", "tokio-rustls", @@ -1524,7 +3630,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ "base64 0.21.7", - "bitflags", + "bitflags 2.6.0", "serde", "serde_derive", ] @@ -1543,11 +3649,11 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.36" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -1568,6 +3674,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + [[package]] name = "rustls-pemfile" version = "2.1.3" @@ -1622,7 +3737,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -1631,9 +3746,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -1667,7 +3782,7 @@ checksum = "8de514ef58196f1fc96dcaef80fe6170a1ce6215df9687a93fe8300e773fefc5" dependencies = [ "form_urlencoded", "indexmap", - "itoa", + "itoa 1.0.11", "ryu", "serde", ] @@ -1678,7 +3793,7 @@ version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "itoa", + "itoa 1.0.11", "memchr", "ryu", "serde", @@ -1690,7 +3805,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ - "itoa", + "itoa 1.0.11", "serde", ] @@ -1710,7 +3825,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa", + "itoa 1.0.11", "ryu", "serde", ] @@ -1726,6 +3841,15 @@ dependencies = [ "digest", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1822,6 +3946,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "sync_wrapper" version = "1.0.1" @@ -1831,15 +3961,36 @@ dependencies = [ "futures-core", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys 0.5.0", +] + [[package]] name = "system-configuration" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags", + "bitflags 2.6.0", "core-foundation", - "system-configuration-sys", + "system-configuration-sys 0.6.0", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", ] [[package]] @@ -1888,24 +4039,34 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "time" version = "0.3.36" @@ -1913,7 +4074,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", - "itoa", + "itoa 1.0.11", "libc", "num-conv", "num_threads", @@ -1961,7 +4122,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", - "bytes", + "bytes 1.7.2", "libc", "mio", "parking_lot", @@ -2010,7 +4171,7 @@ version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ - "bytes", + "bytes 1.7.2", "futures-core", "futures-sink", "pin-project-lite", @@ -2041,9 +4202,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "serde", @@ -2052,27 +4213,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - [[package]] name = "tower-service" version = "0.3.3" @@ -2122,6 +4262,24 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -2175,18 +4333,18 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "universal-hash" @@ -2344,13 +4502,35 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.5" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-registry" version = "0.2.0" @@ -2531,13 +4711,23 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "c52ac009d615e79296318c1bcce2d422aaca15ad08515e344feeda07df67a587" dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "workspace_hack" version = "0.1.0" @@ -2550,7 +4740,7 @@ dependencies = [ "memchr", "proc-macro2", "quote", - "reqwest", + "reqwest 0.12.7", "serde", "serde_json", "smallvec", diff --git a/libs/ui_tests/Cargo.toml b/libs/ui_tests/Cargo.toml index 85053ce8e..60ce25b14 100644 --- a/libs/ui_tests/Cargo.toml +++ b/libs/ui_tests/Cargo.toml @@ -1,7 +1,292 @@ +# Generated by `pavex_test_runner`. +# Do NOT modify it manually. [workspace] members = [ + "app_builder", + "app_builder/generated_app", + "blueprint/common/async_callable_are_supported", + "blueprint/common/async_callable_are_supported/generated_app", + "blueprint/common/cannot_return_the_unit_type", + "blueprint/common/cannot_return_the_unit_type/generated_app", + "blueprint/common/cannot_take_mutable_references_as_input", + "blueprint/common/cannot_take_mutable_references_as_input/generated_app", + "blueprint/common/cloning_if_necessary_requires_clone", + "blueprint/common/cloning_if_necessary_requires_clone/generated_app", + "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs", + "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app", + "blueprint/common/components_can_fail", + "blueprint/common/components_can_fail/generated_app", + "blueprint/common/output_type_must_implement_into_response", + "blueprint/common/output_type_must_implement_into_response/generated_app", + "blueprint/constructors/a_warning_is_emitted_for_unused_constructors", + "blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app", + "blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors", + "blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app", + "blueprint/constructors/constructors_input_parameters_cannot_be_generic", + "blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app", + "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters", + "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app", + "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic", + "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app", + "blueprint/constructors/static_references_are_valid_singletons", + "blueprint/constructors/static_references_are_valid_singletons/generated_app", "blueprint/constructors/the_latest_registered_constructor_takes_precedence", "blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app", + "blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle", + "blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app", + "blueprint/constructors/trait_constraints_on_runtime_singletons", + "blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app", + "blueprint/constructors/unused_constructor_warning_can_be_ignored", + "blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app", + "blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor", + "blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app", + "blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor", + "blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app", + "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type", + "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app", + "blueprint/error_handlers/error_handlers_cannot_be_fallible", + "blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app", + "blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input", + "blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app", + "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error", + "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app", + "blueprint/error_observers/error_observers_input_parameters_cannot_be_generic", + "blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app", + "blueprint/error_observers/error_observers_must_return_the_unit_type", + "blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app", + "blueprint/error_observers/error_observers_must_take_pavex_error_as_ref", + "blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app", + "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes", + "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app", + "blueprint/nesting/multiple_levels_of_nesting_are_supported", + "blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app", + "blueprint/nesting/nest_at_prefix_is_validated", + "blueprint/nesting/nest_at_prefix_is_validated/generated_app", + "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden", + "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app", + "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes", + "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app", + "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp", + "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app", + "blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs", + "blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app", + "blueprint/post_processing_middlewares/finalizer_pattern", + "blueprint/post_processing_middlewares/finalizer_pattern/generated_app", + "blueprint/post_processing_middlewares/must_take_response_as_input", + "blueprint/post_processing_middlewares/must_take_response_as_input/generated_app", + "blueprint/post_processing_middlewares/post_process_without_wrapping", + "blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app", + "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic", + "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app", + "blueprint/pre_processing_middlewares/pre_process_without_wrapping", + "blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app", + "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic", + "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app", + "blueprint/prebuilts/invalid_prebuilt", + "blueprint/prebuilts/invalid_prebuilt/generated_app", + "blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time", + "blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app", + "blueprint/prebuilts/prebuilt_works", + "blueprint/prebuilts/prebuilt_works/generated_app", + "blueprint/prebuilts/prebuilts_can_be_cloned", + "blueprint/prebuilts/prebuilts_can_be_cloned/generated_app", + "blueprint/prebuilts/unused_prebuilt", + "blueprint/prebuilts/unused_prebuilt/generated_app", + "blueprint/router/ambiguous_fallback", + "blueprint/router/ambiguous_fallback/generated_app", + "blueprint/router/conflicting_any_and_single_method_guards", + "blueprint/router/conflicting_any_and_single_method_guards/generated_app", + "blueprint/router/different_fallback_for_each_method", + "blueprint/router/different_fallback_for_each_method/generated_app", + "blueprint/router/fallback_priority", + "blueprint/router/fallback_priority/generated_app", + "blueprint/router/fallback_priority/integration", + "blueprint/router/http_method_routing_variants", + "blueprint/router/http_method_routing_variants/generated_app", + "blueprint/router/invalid_paths", + "blueprint/router/invalid_paths/generated_app", + "blueprint/router/request_handlers_can_take_mut_references", + "blueprint/router/request_handlers_can_take_mut_references/generated_app", + "blueprint/router/route_path_is_validated", + "blueprint/router/route_path_is_validated/generated_app", + "blueprint/router/structs_cannot_be_registered_as_handlers", + "blueprint/router/structs_cannot_be_registered_as_handlers/generated_app", + "blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs", + "blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app", + "blueprint/wrapping_middlewares/must_take_next_as_input", + "blueprint/wrapping_middlewares/must_take_next_as_input/generated_app", + "blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter", + "blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app", + "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic", + "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app", + "borrow_checker/cannot_borrow_clonable_request_scoped_as_mut", + "borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app", + "borrow_checker/cannot_borrow_singletons_as_mut", + "borrow_checker/cannot_borrow_singletons_as_mut/generated_app", + "borrow_checker/cannot_borrow_transients_as_mut", + "borrow_checker/cannot_borrow_transients_as_mut/generated_app", + "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors", + "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app", + "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches", + "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app", + "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy", + "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app", + "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone", + "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app", + "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone", + "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app", + "borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice", + "borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app", + "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice", + "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app", + "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice", + "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app", + "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice", + "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app", + "borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice", + "borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app", + "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice", + "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app", + "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice", + "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app", + "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages", + "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app", + "borrow_checker/mutability", + "borrow_checker/mutability/generated_app", + "borrow_checker/transitive_borrows", + "borrow_checker/transitive_borrows/generated_app", + "borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable", + "borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app", + "borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable", + "borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app", + "borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable", + "borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app", + "borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy", + "borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app", + "borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable", + "borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app", + "borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable", + "borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app", + "borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable", + "borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app", + "borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable", + "borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app", + "connection_info/connection_info_fallback_happy_path", + "connection_info/connection_info_fallback_happy_path/generated_app", + "connection_info/connection_info_fallback_happy_path/integration", + "connection_info/connection_info_happy_path", + "connection_info/connection_info_happy_path/generated_app", + "connection_info/connection_info_happy_path/integration", + "dependency_injection/clone_nodes_are_only_added_where_needed", + "dependency_injection/clone_nodes_are_only_added_where_needed/generated_app", + "dependency_injection/cycles/cycle_across_a_match_statement", + "dependency_injection/cycles/cycle_across_a_match_statement/generated_app", + "dependency_injection/cycles/request_scoped_cycles", + "dependency_injection/cycles/request_scoped_cycles/generated_app", + "dependency_injection/cycles/transient_cycles", + "dependency_injection/cycles/transient_cycles/generated_app", + "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type", + "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app", + "dependency_injection/elided_lifetimes_are_handled", + "dependency_injection/elided_lifetimes_are_handled/generated_app", + "dependency_injection/lifecycles/non_static_references_cannot_be_singletons", + "dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app", + "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped", + "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app", + "dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters", + "dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app", + "dependency_injection/missing_handler_dependency", + "dependency_injection/missing_handler_dependency/generated_app", + "dependency_injection/missing_singleton_dependency", + "dependency_injection/missing_singleton_dependency/generated_app", + "dependency_injection/next_state_is_populated_correctly", + "dependency_injection/next_state_is_populated_correctly/generated_app", + "dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors", + "dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app", + "dependency_injection/references_to_constructible_types_are_allowed", + "dependency_injection/references_to_constructible_types_are_allowed/generated_app", + "dependency_injection/some_types_cannot_be_constructed", + "dependency_injection/some_types_cannot_be_constructed/generated_app", + "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors", + "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app", + "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors", + "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app", + "error_observers/error_observer_with_generic_error", + "error_observers/error_observer_with_generic_error/generated_app", + "error_observers/error_observers_can_depend_on_fallible_singletons", + "error_observers/error_observers_can_depend_on_fallible_singletons/generated_app", + "error_observers/error_observers_happy_path", + "error_observers/error_observers_happy_path/generated_app", + "middlewares/middlewares_execution_order", + "middlewares/middlewares_execution_order/generated_app", + "middlewares/middlewares_execution_order/integration", + "middlewares/next_handles_lifetimes", + "middlewares/next_handles_lifetimes/generated_app", + "middlewares/next_handles_mut_references", + "middlewares/next_handles_mut_references/generated_app", + "middlewares/request_scoped_state_is_shared_correctly_among_middlewares", + "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app", + "path_parameters/path_parameters_happy_path", + "path_parameters/path_parameters_happy_path/generated_app", + "path_parameters/path_parameters_happy_path/integration", + "path_parameters/path_parameters_non_existing_fields", + "path_parameters/path_parameters_non_existing_fields/generated_app", + "path_parameters/path_parameters_unsupported_types", + "path_parameters/path_parameters_unsupported_types/generated_app", + "reflection/a_fix_is_suggested_for_function_invocations", + "reflection/a_fix_is_suggested_for_function_invocations/generated_app", + "reflection/ambiguous_dependency_version_is_handled", + "reflection/ambiguous_dependency_version_is_handled/generated_app", + "reflection/arc_singletons_are_supported", + "reflection/arc_singletons_are_supported/generated_app", + "reflection/common_response_types_are_supported", + "reflection/common_response_types_are_supported/generated_app", + "reflection/crate_resolution/dependencies_can_register_local_items", + "reflection/crate_resolution/dependencies_can_register_local_items/generated_app", + "reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported", + "reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app", + "reflection/crate_resolution/remote_callable_paths_must_be_absolute", + "reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app", + "reflection/crate_resolution/transitive_dependencies_can_be_renamed", + "reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app", + "reflection/generic_handlers_are_supported", + "reflection/generic_handlers_are_supported/generated_app", + "reflection/generic_parameters_can_come_from_another_crate", + "reflection/generic_parameters_can_come_from_another_crate/generated_app", + "reflection/invalid_callable_path", + "reflection/invalid_callable_path/generated_app", + "reflection/lifetime_restrictions_are_handled", + "reflection/lifetime_restrictions_are_handled/generated_app", + "reflection/local_callable_paths_must_be_prefixed_with_crate", + "reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app", + "reflection/local_glob_reexports_are_supported", + "reflection/local_glob_reexports_are_supported/generated_app", + "reflection/non_static_methods_are_supported", + "reflection/non_static_methods_are_supported/generated_app", + "reflection/output_parameter_cannot_be_handled", + "reflection/output_parameter_cannot_be_handled/generated_app", + "reflection/pattern_bindings_in_input_parameters_are_supported", + "reflection/pattern_bindings_in_input_parameters_are_supported/generated_app", + "reflection/reexported_type_alias_work", + "reflection/reexported_type_alias_work/generated_app", + "reflection/relative_paths_prefixed_with_self_are_supported", + "reflection/relative_paths_prefixed_with_self_are_supported/generated_app", + "reflection/relative_paths_prefixed_with_super_are_supported", + "reflection/relative_paths_prefixed_with_super_are_supported/generated_app", + "reflection/self_as_generic_parameter_is_supported", + "reflection/self_as_generic_parameter_is_supported/generated_app", + "reflection/static_methods_are_supported", + "reflection/static_methods_are_supported/generated_app", + "reflection/the_path_for_generic_arguments_must_be_absolute", + "reflection/the_path_for_generic_arguments_must_be_absolute/generated_app", + "reflection/trait_methods_are_supported", + "reflection/trait_methods_are_supported/generated_app", + "reflection/trait_methods_with_non_local_generics_are_supported", + "reflection/trait_methods_with_non_local_generics_are_supported/generated_app", + "reflection/tuples_are_supported", + "reflection/tuples_are_supported/generated_app", + "reflection/type_alias_are_supported", + "reflection/type_alias_are_supported/generated_app", ] resolver = "2" [workspace.dependencies] diff --git a/libs/ui_tests/app_builder/generated_app/Cargo.toml b/libs/ui_tests/app_builder/generated_app/Cargo.toml index ef040f13e..53d61c6b5 100644 --- a/libs/ui_tests/app_builder/generated_app/Cargo.toml +++ b/libs/ui_tests/app_builder/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_f10df8fa = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/app_builder/generated_app/src/lib.rs b/libs/ui_tests/app_builder/generated_app/src/lib.rs index 4fb7a2e92..e69de29bb 100644 --- a/libs/ui_tests/app_builder/generated_app/src/lib.rs +++ b/libs/ui_tests/app_builder/generated_app/src/lib.rs @@ -1,196 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_f10df8fa::HttpClient, -} -pub async fn build_application_state( - v0: app_f10df8fa::Config, -) -> crate::ApplicationState { - let v1 = app_f10df8fa::http_client(v0); - crate::ApplicationState { s0: v1 } -} -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("/home", 0u32).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_1::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::GET => { - route_0::entrypoint( - server_state.application_state.s0.clone(), - request_head, - ) - .await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint( - s_0: app_f10df8fa::HttpClient, - s_1: pavex::request::RequestHead, - ) -> pavex::response::Response { - let response = wrapping_0(s_0, s_1).await; - response - } - async fn stage_1( - s_0: app_f10df8fa::HttpClient, - s_1: pavex::request::RequestHead, - ) -> pavex::response::Response { - let response = handler(s_0, s_1).await; - response - } - async fn wrapping_0( - v0: app_f10df8fa::HttpClient, - v1: pavex::request::RequestHead, - ) -> pavex::response::Response { - let v2 = crate::route_0::Next0 { - s_0: v0, - s_1: v1, - next: stage_1, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = pavex::middleware::wrap_noop(v3).await; - ::into_response(v4) - } - async fn handler( - v0: app_f10df8fa::HttpClient, - v1: pavex::request::RequestHead, - ) -> pavex::response::Response { - let v2 = app_f10df8fa::extract_path(v1).await; - let v3 = match v2 { - Ok(ok) => ok, - Err(v3) => { - return { - let v5 = { - let v4 = app_f10df8fa::logger(); - app_f10df8fa::handle_extract_path_error(&v3, v4) - }; - ::into_response( - v5, - ) - }; - } - }; - let v5 = { - let v4 = app_f10df8fa::logger(); - app_f10df8fa::stream_file(v3, v4, v0) - }; - ::into_response(v5) - } - struct Next0 - where - T: std::future::Future, - { - s_0: app_f10df8fa::HttpClient, - s_1: pavex::request::RequestHead, - next: fn(app_f10df8fa::HttpClient, pavex::request::RequestHead) -> 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)(self.s_0, self.s_1) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml index 5fb589fcf..4194ea107 100644 --- a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_c62eca9e = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/src/lib.rs index 003c97e75..e69de29bb 100644 --- a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/src/lib.rs @@ -1,179 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_c62eca9e::HttpClient, -} -pub async fn build_application_state( - v0: app_c62eca9e::Config, -) -> crate::ApplicationState { - let v1 = app_c62eca9e::http_client(v0).await; - crate::ApplicationState { s0: v1 } -} -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("/home", 0u32).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_1::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::GET => { - route_0::entrypoint(request_head, &server_state.application_state.s0) - .await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>( - s_0: pavex::request::RequestHead, - s_1: &'a app_c62eca9e::HttpClient, - ) -> pavex::response::Response { - let response = wrapping_0(s_0, s_1).await; - response - } - async fn stage_1<'a>( - s_0: pavex::request::RequestHead, - s_1: &'a app_c62eca9e::HttpClient, - ) -> pavex::response::Response { - let response = handler(s_0, s_1).await; - response - } - async fn wrapping_0( - v0: pavex::request::RequestHead, - v1: &app_c62eca9e::HttpClient, - ) -> pavex::response::Response { - let v2 = crate::route_0::Next0 { - s_0: v0, - s_1: v1, - next: stage_1, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = pavex::middleware::wrap_noop(v3).await; - ::into_response(v4) - } - async fn handler( - v0: pavex::request::RequestHead, - v1: &app_c62eca9e::HttpClient, - ) -> pavex::response::Response { - let v2 = app_c62eca9e::extract_path(v0).await; - let v4 = { - let v3 = app_c62eca9e::logger().await; - app_c62eca9e::stream_file(v2, v3, v1).await - }; - ::into_response(v4) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: pavex::request::RequestHead, - s_1: &'a app_c62eca9e::HttpClient, - next: fn(pavex::request::RequestHead, &'a app_c62eca9e::HttpClient) -> 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, self.s_1) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml index 1ae7cc525..1ef56ce2f 100644 --- a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_e501823b = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/src/lib.rs index 522f6a873..e69de29bb 100644 --- a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/src/lib.rs @@ -1,407 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_e501823b::HttpClient, -} -#[derive(Debug, thiserror::Error)] -pub enum ApplicationStateError { - #[error(transparent)] - HttpClient(app_e501823b::HttpClientError), -} -pub async fn build_application_state( - v0: app_e501823b::Config, -) -> Result { - let v1 = app_e501823b::http_client(v0); - let v2 = match v1 { - Ok(ok) => ok, - Err(v2) => { - return { - let v3 = crate::ApplicationStateError::HttpClient(v2); - core::result::Result::Err(v3) - }; - } - }; - let v3 = crate::ApplicationState { s0: v2 }; - core::result::Result::Ok(v3) -} -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("/home", 0u32).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_1::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::GET => { - route_0::entrypoint(request_head, &server_state.application_state.s0) - .await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>( - s_0: pavex::request::RequestHead, - s_1: &'a app_e501823b::HttpClient, - ) -> pavex::response::Response { - let response = wrapping_0(s_0, s_1).await; - response - } - async fn stage_1<'a>( - s_0: pavex::request::RequestHead, - s_1: &'a app_e501823b::HttpClient, - ) -> pavex::response::Response { - let response = wrapping_1(s_0, s_1).await; - response - } - async fn stage_2<'a>( - s_0: pavex::request::RequestHead, - s_1: &'a app_e501823b::HttpClient, - ) -> pavex::response::Response { - if let Some(response) = pre_processing_0().await.into_response() { - return response; - } - let response = handler(s_0, s_1).await; - let response = post_processing_0(response).await; - response - } - async fn wrapping_0( - v0: pavex::request::RequestHead, - v1: &app_e501823b::HttpClient, - ) -> pavex::response::Response { - let v2 = crate::route_0::Next0 { - s_0: v0, - s_1: v1, - next: stage_1, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = pavex::middleware::wrap_noop(v3).await; - ::into_response(v4) - } - async fn wrapping_1( - v0: pavex::request::RequestHead, - v1: &app_e501823b::HttpClient, - ) -> pavex::response::Response { - let v2 = crate::route_0::Next1 { - s_0: v0, - s_1: v1, - next: stage_2, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = app_e501823b::fallible_wrapping_middleware(v3); - let v5 = match v4 { - Ok(ok) => ok, - Err(v5) => { - return { - let v6 = app_e501823b::handle_middleware_error(&v5); - ::into_response( - v6, - ) - }; - } - }; - ::into_response(v5) - } - async fn pre_processing_0() -> pavex::middleware::Processing< - pavex::response::Response, - > { - let v0 = app_e501823b::fallible_pre(); - let v1 = match v0 { - Ok(ok) => ok, - Err(v1) => { - return { - let v2 = app_e501823b::pre_error(&v1); - let v3 = ::into_response( - v2, - ); - pavex::middleware::Processing::EarlyReturn(v3) - }; - } - }; - v1 - } - async fn handler( - v0: pavex::request::RequestHead, - v1: &app_e501823b::HttpClient, - ) -> pavex::response::Response { - let v2 = match app_e501823b::logger() { - Ok(ok) => ok, - Err(v2) => { - return { - let v3 = app_e501823b::handle_logger_error(&v2); - ::into_response( - v3, - ) - }; - } - }; - let v3 = app_e501823b::extract_path(v0); - let v4 = match v3 { - Ok(ok) => ok, - Err(v4) => { - return { - let v5 = match app_e501823b::logger() { - Ok(ok) => ok, - Err(v5) => { - return { - let v6 = app_e501823b::handle_logger_error(&v5); - ::into_response( - v6, - ) - }; - } - }; - let v6 = app_e501823b::handle_extract_path_error(&v4, v5); - ::into_response( - v6, - ) - }; - } - }; - let v5 = app_e501823b::request_handler(v4, v2, v1); - let v6 = match v5 { - Ok(ok) => ok, - Err(v6) => { - return { - let v7 = app_e501823b::handle_handler_error(&v6); - ::into_response( - v7, - ) - }; - } - }; - ::into_response(v6) - } - async fn post_processing_0( - v0: pavex::response::Response, - ) -> pavex::response::Response { - let v1 = app_e501823b::fallible_post(v0); - let v2 = match v1 { - Ok(ok) => ok, - Err(v2) => { - return { - let v3 = app_e501823b::post_error(&v2); - ::into_response( - v3, - ) - }; - } - }; - ::into_response(v2) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: pavex::request::RequestHead, - s_1: &'a app_e501823b::HttpClient, - next: fn(pavex::request::RequestHead, &'a app_e501823b::HttpClient) -> 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, self.s_1) - } - } - struct Next1<'a, T> - where - T: std::future::Future, - { - s_0: pavex::request::RequestHead, - s_1: &'a app_e501823b::HttpClient, - next: fn(pavex::request::RequestHead, &'a app_e501823b::HttpClient) -> T, - } - impl<'a, T> std::future::IntoFuture for Next1<'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, self.s_1) - } - } -} -pub mod route_1 { - 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 = wrapping_1(s_0).await; - response - } - async fn stage_2<'a>( - s_0: &'a pavex::router::AllowedMethods, - ) -> pavex::response::Response { - if let Some(response) = pre_processing_0().await.into_response() { - return response; - } - let response = handler(s_0).await; - let response = post_processing_0(response).await; - response - } - async fn wrapping_0( - v0: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v1 = crate::route_1::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 wrapping_1( - v0: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v1 = crate::route_1::Next1 { - s_0: v0, - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_e501823b::fallible_wrapping_middleware(v2); - let v4 = match v3 { - Ok(ok) => ok, - Err(v4) => { - return { - let v5 = app_e501823b::handle_middleware_error(&v4); - ::into_response( - v5, - ) - }; - } - }; - ::into_response(v4) - } - async fn pre_processing_0() -> pavex::middleware::Processing< - pavex::response::Response, - > { - let v0 = app_e501823b::fallible_pre(); - let v1 = match v0 { - Ok(ok) => ok, - Err(v1) => { - return { - let v2 = app_e501823b::pre_error(&v1); - let v3 = ::into_response( - v2, - ); - pavex::middleware::Processing::EarlyReturn(v3) - }; - } - }; - v1 - } - async fn handler(v0: &pavex::router::AllowedMethods) -> pavex::response::Response { - let v1 = pavex::router::default_fallback(v0).await; - ::into_response(v1) - } - async fn post_processing_0( - v0: pavex::response::Response, - ) -> pavex::response::Response { - let v1 = app_e501823b::fallible_post(v0); - let v2 = match v1 { - Ok(ok) => ok, - Err(v2) => { - return { - let v3 = app_e501823b::post_error(&v2); - ::into_response( - v3, - ) - }; - } - }; - ::into_response(v2) - } - 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) - } - } - struct Next1<'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 Next1<'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) - } - } -} diff --git a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml index 2766fbe13..73a04e923 100644 --- a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml @@ -6,10 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/src/lib.rs index 74f099cc2..e69de29bb 100644 --- a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/src/lib.rs @@ -1,101 +0,0 @@ -//! 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 -} -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_0::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 { - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - 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_0::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) - } - } -} diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml index e18dff32b..33a3fa0c3 100644 --- a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_ea979460 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/src/lib.rs index e785a9006..e69de29bb 100644 --- a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/src/lib.rs @@ -1,204 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_ea979460::fallible_with_generic_error2(); - let v1 = match v0 { - Ok(ok) => ok, - Err(v1) => { - return { - let v2 = app_ea979460::json(); - let v3 = app_ea979460::doubly_generic_error_handler(&v1, &v2); - ::into_response( - v3, - ) - }; - } - }; - let v2 = app_ea979460::fallible_with_generic_error(); - let v3 = match v2 { - Ok(ok) => ok, - Err(v3) => { - return { - let v4 = app_ea979460::generic_error_handler(&v3); - ::into_response( - v4, - ) - }; - } - }; - let v4 = app_ea979460::fallible_with_generic_error(); - let v5 = match v4 { - Ok(ok) => ok, - Err(v5) => { - return { - let v6 = app_ea979460::generic_error_handler(&v5); - ::into_response( - v6, - ) - }; - } - }; - let v6 = app_ea979460::fallible(); - let v7 = match v6 { - Ok(ok) => ok, - Err(v7) => { - return { - let v8 = app_ea979460::error_handler(&v7); - ::into_response( - v8, - ) - }; - } - }; - let v8 = app_ea979460::json(); - let v9 = app_ea979460::json(); - let v10 = app_ea979460::json(); - let v11 = app_ea979460::handler(v8, v10, &v9, v7, v5, &v3, &v1); - ::into_response(v11) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml index 6012553e6..44a59cc3c 100644 --- a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_d0f81bc0 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/src/lib.rs index 971aa6635..e69de29bb 100644 --- a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/src/lib.rs @@ -1,158 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: &'static str, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_d0f81bc0::static_str(); - crate::ApplicationState { s0: v0 } -} -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("/handler", 0u32).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_1::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::GET => { - route_0::entrypoint(server_state.application_state.s0.clone()).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint(s_0: &'static str) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1(s_0: &'static str) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: &'static str) -> pavex::response::Response { - let v1 = crate::route_0::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: &'static str) -> pavex::response::Response { - let v1 = app_d0f81bc0::handler(v0); - ::into_response(v1) - } - struct Next0 - where - T: std::future::Future, - { - s_0: &'static str, - next: fn(&'static str) -> 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)(self.s_0) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml index f559a997c..58841cafd 100644 --- a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml @@ -6,12 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_55dca802 = { version = "0.1.0", path = ".." } -dep_55dca802 = { version = "0.1.0", path = "../ephemeral_deps/dep" } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/src/lib.rs index 49d972dbc..e69de29bb 100644 --- a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/src/lib.rs @@ -1,153 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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 = dep_55dca802::new_logger(); - let v1 = app_55dca802::Streamer::stream_file(v0); - ::into_response(v1) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml index ac6d28118..ac64ee726 100644 --- a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_621e9d53 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/src/lib.rs index fcf338cba..e69de29bb 100644 --- a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/src/lib.rs @@ -1,153 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_621e9d53::new_logger(); - let v1 = app_621e9d53::Streamer::stream_file(v0); - ::into_response(v1) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml index a04174fca..07c476727 100644 --- a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml @@ -6,10 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/src/lib.rs index 74f099cc2..e69de29bb 100644 --- a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/src/lib.rs @@ -1,101 +0,0 @@ -//! 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 -} -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_0::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 { - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - 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_0::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) - } - } -} diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml index b19f49076..7062f8b31 100644 --- a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_40a0f751 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/src/lib.rs index 9c15124a2..e69de29bb 100644 --- a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/src/lib.rs @@ -1,230 +0,0 @@ -//! 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("/with_observer", 0u32).unwrap(); - router.insert("/without_observer", 1u32).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_1::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::GET => route_2::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - 1u32 => { - match &request_head.method { - &pavex::http::Method::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_40a0f751::fallible_constructor(); - let v1 = match v0 { - Ok(ok) => ok, - Err(v1) => { - return { - let v2 = pavex::Error::new(v1); - let v3 = app_40a0f751::error_handler(&v2); - ::into_response( - v3, - ) - }; - } - }; - let v2 = app_40a0f751::handler(v1); - ::into_response(v2) - } - 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<'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_1::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) - } - } -} -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_40a0f751::fallible_constructor(); - let v1 = match v0 { - Ok(ok) => ok, - Err(v1) => { - return { - let v2 = pavex::Error::new(v1); - let v3 = app_40a0f751::error_handler(&v2); - app_40a0f751::error_observer(&v2); - ::into_response( - v3, - ) - }; - } - }; - let v2 = app_40a0f751::handler(v1); - ::into_response(v2) - } - 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)() - } - } -} diff --git a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml index 20f2bd9b1..7a23fd18b 100644 --- a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_ea86e18a = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/src/lib.rs index cd6a26167..e69de29bb 100644 --- a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/src/lib.rs @@ -1,219 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: u64, - s1: u32, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_ea86e18a::singleton_dep(); - let v1 = app_ea86e18a::nested_singleton(v0); - let v2 = app_ea86e18a::parent_singleton(); - crate::ApplicationState { - s0: v2, - s1: v1, - } -} -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("/child", 0u32).unwrap(); - router.insert("/parent", 1u32).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_1::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::GET => { - route_2::entrypoint(server_state.application_state.s1.clone()).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - 1u32 => { - match &request_head.method { - &pavex::http::Method::GET => { - route_0::entrypoint(server_state.application_state.s0.clone()).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint(s_0: u64) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1(s_0: u64) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: u64) -> pavex::response::Response { - let v1 = crate::route_0::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: u64) -> pavex::response::Response { - let v1 = app_ea86e18a::parent_handler(v0); - ::into_response(v1) - } - struct Next0 - where - T: std::future::Future, - { - s_0: u64, - next: fn(u64) -> 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)(self.s_0) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} -pub mod route_2 { - pub async fn entrypoint(s_0: u32) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1(s_0: u32) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: u32) -> pavex::response::Response { - let v1 = crate::route_2::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: u32) -> pavex::response::Response { - let v1 = app_ea86e18a::nested_handler(v0); - ::into_response(v1) - } - struct Next0 - where - T: std::future::Future, - { - s_0: u32, - next: fn(u32) -> 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)(self.s_0) - } - } -} diff --git a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml index 7794a5ebe..1cd90c198 100644 --- a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_91e1ac20 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/src/lib.rs index 3628be1ee..e69de29bb 100644 --- a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/src/lib.rs @@ -1,155 +0,0 @@ -//! 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("/first/second/third/home", 0u32).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_0::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::GET => route_1::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_0::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - 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_0::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) - } - } -} -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_91e1ac20::first(); - let v1 = app_91e1ac20::second(v0); - let v2 = app_91e1ac20::third(v1); - let v3 = app_91e1ac20::handler(v2); - ::into_response(v3) - } - 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)() - } - } -} diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml index 1f877ed5d..fa5c60865 100644 --- a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_41064ffa = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/src/lib.rs index b919217b5..e69de29bb 100644 --- a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/src/lib.rs @@ -1,207 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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(mut s_0: app_41064ffa::A) -> pavex::response::Response { - let response = handler(&mut s_0).await; - let response = post_processing_0(response, &mut s_0).await; - let response = post_processing_1(response, &mut s_0).await; - let response = post_processing_2(response, s_0).await; - response - } - async fn wrapping_0() -> pavex::response::Response { - let v0 = app_41064ffa::a(); - let v1 = crate::route_0::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: &mut app_41064ffa::A) -> pavex::response::Response { - let v1 = app_41064ffa::handler(v0); - ::into_response(v1) - } - async fn post_processing_0( - v0: pavex::response::Response, - v1: &mut app_41064ffa::A, - ) -> pavex::response::Response { - let v2 = app_41064ffa::first(v0, v1); - ::into_response(v2) - } - async fn post_processing_1( - v0: pavex::response::Response, - v1: &mut app_41064ffa::A, - ) -> pavex::response::Response { - let v2 = app_41064ffa::second(v0, v1); - ::into_response(v2) - } - async fn post_processing_2( - v0: pavex::response::Response, - v1: app_41064ffa::A, - ) -> pavex::response::Response { - let v2 = app_41064ffa::third(v0, v1); - ::into_response(v2) - } - struct Next0 - where - T: std::future::Future, - { - s_0: app_41064ffa::A, - next: fn(app_41064ffa::A) -> 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)(self.s_0) - } - } -} -pub mod route_1 { - 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>( - mut s_0: app_41064ffa::A, - s_1: &'a pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let response = handler(s_1).await; - let response = post_processing_0(response, &mut s_0).await; - let response = post_processing_1(response, &mut s_0).await; - let response = post_processing_2(response, s_0).await; - response - } - async fn wrapping_0( - v0: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v1 = app_41064ffa::a(); - let v2 = crate::route_1::Next0 { - s_0: v1, - s_1: v0, - next: stage_1, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = pavex::middleware::wrap_noop(v3).await; - ::into_response(v4) - } - async fn handler(v0: &pavex::router::AllowedMethods) -> pavex::response::Response { - let v1 = pavex::router::default_fallback(v0).await; - ::into_response(v1) - } - async fn post_processing_0( - v0: pavex::response::Response, - v1: &mut app_41064ffa::A, - ) -> pavex::response::Response { - let v2 = app_41064ffa::first(v0, v1); - ::into_response(v2) - } - async fn post_processing_1( - v0: pavex::response::Response, - v1: &mut app_41064ffa::A, - ) -> pavex::response::Response { - let v2 = app_41064ffa::second(v0, v1); - ::into_response(v2) - } - async fn post_processing_2( - v0: pavex::response::Response, - v1: app_41064ffa::A, - ) -> pavex::response::Response { - let v2 = app_41064ffa::third(v0, v1); - ::into_response(v2) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: app_41064ffa::A, - s_1: &'a pavex::router::AllowedMethods, - next: fn(app_41064ffa::A, &'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, self.s_1) - } - } -} diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml index 0fcbff93d..af1396c50 100644 --- a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_c8000fe9 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/src/lib.rs index c8a5556e4..e69de29bb 100644 --- a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/src/lib.rs @@ -1,166 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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; - let response = post_processing_0(response).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_c8000fe9::handler(); - ::into_response(v0) - } - async fn post_processing_0( - v0: pavex::response::Response, - ) -> pavex::response::Response { - let v1 = app_c8000fe9::mw(v0); - ::into_response(v1) - } - 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<'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; - let response = post_processing_0(response).await; - response - } - async fn wrapping_0( - v0: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v1 = crate::route_1::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) - } - async fn post_processing_0( - v0: pavex::response::Response, - ) -> pavex::response::Response { - let v1 = app_c8000fe9::mw(v0); - ::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) - } - } -} diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml index 61aa1ff0e..9a8735420 100644 --- a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_8ac65a81 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/src/lib.rs b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/src/lib.rs index 9886dbc2b..e69de29bb 100644 --- a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/src/lib.rs @@ -1,168 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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 { - if let Some(response) = pre_processing_0().await.into_response() { - return 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 pre_processing_0() -> pavex::middleware::Processing< - pavex::response::Response, - > { - app_8ac65a81::pre() - } - async fn handler() -> pavex::response::Response { - let v0 = app_8ac65a81::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<'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 { - if let Some(response) = pre_processing_0().await.into_response() { - return response; - } - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v1 = crate::route_1::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 pre_processing_0() -> pavex::middleware::Processing< - pavex::response::Response, - > { - app_8ac65a81::pre() - } - 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) - } - } -} diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml index c1f24740e..ddbd18f7f 100644 --- a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_776ff188 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/src/lib.rs index ce7571aa5..e69de29bb 100644 --- a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/src/lib.rs @@ -1,158 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_776ff188::B, -} -pub async fn build_application_state(v0: app_776ff188::A) -> crate::ApplicationState { - let v1 = app_776ff188::b(v0); - crate::ApplicationState { s0: v1 } -} -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("/", 0u32).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_1::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::GET => { - route_0::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>(s_0: &'a app_776ff188::B) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>(s_0: &'a app_776ff188::B) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: &app_776ff188::B) -> pavex::response::Response { - let v1 = crate::route_0::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: &app_776ff188::B) -> pavex::response::Response { - let v1 = app_776ff188::handler(v0); - ::into_response(v1) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_776ff188::B, - next: fn(&'a app_776ff188::B) -> 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) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml index 6b4c9e6bd..0b7bcc33d 100644 --- a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_e4a8214b = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/src/lib.rs index eee6b3104..e69de29bb 100644 --- a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/src/lib.rs @@ -1,207 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_e4a8214b::A, - s1: app_e4a8214b::C<'static>, - s2: alloc::vec::Vec, - s3: app_e4a8214b::B, -} -pub async fn build_application_state( - v0: app_e4a8214b::A, - v1: app_e4a8214b::C<'static>, - v2: alloc::vec::Vec, - v3: app_e4a8214b::B, -) -> crate::ApplicationState { - crate::ApplicationState { - s0: v0, - s1: v1, - s2: v2, - s3: v3, - } -} -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("/", 0u32).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_1::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::GET => { - route_0::entrypoint( - &server_state.application_state.s0, - server_state.application_state.s1.clone(), - server_state.application_state.s2.clone(), - &server_state.application_state.s3, - ) - .await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a, 'b>( - s_0: &'a app_e4a8214b::A, - s_1: app_e4a8214b::C<'static>, - s_2: alloc::vec::Vec, - s_3: &'b app_e4a8214b::B, - ) -> pavex::response::Response { - let response = wrapping_0(s_0, s_1, s_2, s_3).await; - response - } - async fn stage_1<'a, 'b>( - s_0: &'a app_e4a8214b::B, - s_1: app_e4a8214b::C<'static>, - s_2: alloc::vec::Vec, - s_3: &'b app_e4a8214b::A, - ) -> pavex::response::Response { - let response = handler(s_0, s_1, s_2, s_3).await; - response - } - async fn wrapping_0( - v0: &app_e4a8214b::A, - v1: app_e4a8214b::C<'static>, - v2: alloc::vec::Vec, - v3: &app_e4a8214b::B, - ) -> pavex::response::Response { - let v4 = crate::route_0::Next0 { - s_0: v3, - s_1: v1, - s_2: v2, - s_3: v0, - next: stage_1, - }; - let v5 = pavex::middleware::Next::new(v4); - let v6 = pavex::middleware::wrap_noop(v5).await; - ::into_response(v6) - } - async fn handler( - v0: &app_e4a8214b::B, - v1: app_e4a8214b::C<'static>, - v2: alloc::vec::Vec, - v3: &app_e4a8214b::A, - ) -> pavex::response::Response { - let v4 = app_e4a8214b::handler(v3, v0, v1, v2); - ::into_response(v4) - } - struct Next0<'a, 'b, T> - where - T: std::future::Future, - { - s_0: &'a app_e4a8214b::B, - s_1: app_e4a8214b::C<'static>, - s_2: alloc::vec::Vec, - s_3: &'b app_e4a8214b::A, - next: fn( - &'a app_e4a8214b::B, - app_e4a8214b::C<'static>, - alloc::vec::Vec, - &'b app_e4a8214b::A, - ) -> T, - } - impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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, self.s_1, self.s_2, self.s_3) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml index ccafadca1..2268cbac8 100644 --- a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_4c9069e8 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/src/lib.rs index c46b75036..e69de29bb 100644 --- a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/src/lib.rs @@ -1,181 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_4c9069e8::A, - s1: app_4c9069e8::B, -} -pub async fn build_application_state(v0: app_4c9069e8::A) -> crate::ApplicationState { - let v1 = ::clone(&v0); - let v2 = app_4c9069e8::b(v0); - crate::ApplicationState { - s0: v1, - s1: v2, - } -} -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("/", 0u32).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_1::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::GET => { - route_0::entrypoint( - server_state.application_state.s0.clone(), - &server_state.application_state.s1, - ) - .await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>( - s_0: app_4c9069e8::A, - s_1: &'a app_4c9069e8::B, - ) -> pavex::response::Response { - let response = wrapping_0(s_0, s_1).await; - response - } - async fn stage_1<'a>( - s_0: app_4c9069e8::A, - s_1: &'a app_4c9069e8::B, - ) -> pavex::response::Response { - let response = handler(s_0, s_1).await; - response - } - async fn wrapping_0( - v0: app_4c9069e8::A, - v1: &app_4c9069e8::B, - ) -> pavex::response::Response { - let v2 = crate::route_0::Next0 { - s_0: v0, - s_1: v1, - next: stage_1, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = pavex::middleware::wrap_noop(v3).await; - ::into_response(v4) - } - async fn handler( - v0: app_4c9069e8::A, - v1: &app_4c9069e8::B, - ) -> pavex::response::Response { - let v2 = app_4c9069e8::handler(v0, v1); - ::into_response(v2) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: app_4c9069e8::A, - s_1: &'a app_4c9069e8::B, - next: fn(app_4c9069e8::A, &'a app_4c9069e8::B) -> 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, self.s_1) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml index 1db7a9cd5..7c25a7523 100644 --- a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml @@ -6,10 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/src/lib.rs index 74f099cc2..e69de29bb 100644 --- a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/src/lib.rs @@ -1,101 +0,0 @@ -//! 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 -} -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_0::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 { - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - 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_0::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) - } - } -} diff --git a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml index 696e106ff..58a06b2a9 100644 --- a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_78452ff2 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/src/lib.rs index e4257f8ae..e69de29bb 100644 --- a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/src/lib.rs @@ -1,269 +0,0 @@ -//! 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("/users*catch_all", 0u32).unwrap(); - router.insert("/users/", 1u32).unwrap(); - router.insert("/users/id", 2u32).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_0::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 => route_2::entrypoint().await, - 1u32 => { - match &request_head.method { - &pavex::http::Method::GET => route_1::entrypoint().await, - _ => route_2::entrypoint().await, - } - } - 2u32 => { - match &request_head.method { - &pavex::http::Method::GET => route_3::entrypoint().await, - _ => route_4::entrypoint().await, - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - 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_0::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) - } - } -} -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_78452ff2::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_78452ff2::unauthorized(); - ::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_78452ff2::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_78452ff2::forbidden(); - ::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)() - } - } -} diff --git a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml index 900962ba3..d09d063f8 100644 --- a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_a6a2e116 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/src/lib.rs index 49ff64761..e69de29bb 100644 --- a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/src/lib.rs @@ -1,831 +0,0 @@ -//! 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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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_a6a2e116::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) - } - } -} diff --git a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml index e177f3d42..5eb783788 100644 --- a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml +++ b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_c7a5ef25 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/src/lib.rs index fc618e58e..e69de29bb 100644 --- a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/src/lib.rs +++ b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/src/lib.rs @@ -1,153 +0,0 @@ -//! 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("/", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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 mut v0 = app_c7a5ef25::build(); - let v1 = app_c7a5ef25::handler(&mut v0); - ::into_response(v1) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml index 72b64b062..a1cfa8f0d 100644 --- a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_9717f587 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/src/lib.rs index 39712ae5b..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/src/lib.rs @@ -1,166 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_9717f587::a(); - let v1 = match v0 { - Ok(ok) => ok, - Err(v1) => { - return { - let v2 = app_9717f587::b(); - let v3 = app_9717f587::error_handler(&v1, v2); - ::into_response( - v3, - ) - }; - } - }; - let v2 = app_9717f587::b(); - let v3 = app_9717f587::handler(v1, v2); - ::into_response(v3) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml index 865d4d0ca..5c88d7da8 100644 --- a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_74f21254 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/src/lib.rs index 5adfbe3fb..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/src/lib.rs @@ -1,156 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_74f21254::b(); - let v1 = app_74f21254::a(); - let v2 = app_74f21254::d(&v1, v0); - let v3 = app_74f21254::c(v1, &v0); - let v4 = app_74f21254::handler(v3, v2); - ::into_response(v4) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml index bc5532a2b..bcaa5f808 100644 --- a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_e8f51606 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/src/lib.rs index 42c8b4843..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/src/lib.rs @@ -1,157 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_e8f51606::a(); - let v1 = app_e8f51606::b(); - let v2 = ::clone(&v1); - let v3 = app_e8f51606::d(&v0, v2); - let v4 = app_e8f51606::c(v0, &v1); - let v5 = app_e8f51606::handler(v4, v3); - ::into_response(v5) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml index 8f6a07f0c..b4396aba4 100644 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_821d919e = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/src/lib.rs index 94d63140d..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/src/lib.rs @@ -1,168 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint(url_params).await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a, 'b>( - s_0: pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a, 'b>( - s_0: pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: pavex::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = crate::route_0::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::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = as core::clone::Clone>::clone(&v0); - let v2 = app_821d919e::b(v1); - let v3 = app_821d919e::c(v0); - let v4 = app_821d919e::handler(v2, v3); - ::into_response(v4) - } - struct Next0<'a, 'b, T> - where - T: std::future::Future, - { - s_0: pavex::request::path::RawPathParams<'a, 'b>, - next: fn(pavex::request::path::RawPathParams<'a, 'b>) -> T, - } - impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml index d2665ef72..a8516bdc1 100644 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_e1c9a48c = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/src/lib.rs index 8101fd98e..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/src/lib.rs @@ -1,161 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_e1c9a48c::A, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_e1c9a48c::a(); - crate::ApplicationState { s0: v0 } -} -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("/home", 0u32).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_1::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::GET => { - route_0::entrypoint(server_state.application_state.s0.clone()).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint(s_0: app_e1c9a48c::A) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1(s_0: app_e1c9a48c::A) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: app_e1c9a48c::A) -> pavex::response::Response { - let v1 = crate::route_0::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: app_e1c9a48c::A) -> pavex::response::Response { - let v1 = ::clone(&v0); - let v2 = app_e1c9a48c::b(v1); - let v3 = app_e1c9a48c::c(v0); - let v4 = app_e1c9a48c::handler(v2, v3); - ::into_response(v4) - } - struct Next0 - where - T: std::future::Future, - { - s_0: app_e1c9a48c::A, - next: fn(app_e1c9a48c::A) -> 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)(self.s_0) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml index 212e8c0c9..7cf80ac96 100644 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_9b6ffdef = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/src/lib.rs index 33f3372b6..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/src/lib.rs @@ -1,156 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_9b6ffdef::a(); - let v1 = ::clone(&v0); - let v2 = app_9b6ffdef::b(v1); - let v3 = app_9b6ffdef::c(v0); - let v4 = app_9b6ffdef::handler(v2, v3); - ::into_response(v4) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml index 1807633b3..6cf649a82 100644 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_ba0e5d33 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/src/lib.rs index a692b9f03..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/src/lib.rs @@ -1,155 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_ba0e5d33::a(); - let v1 = app_ba0e5d33::c(v0); - let v2 = app_ba0e5d33::b(v0); - let v3 = app_ba0e5d33::handler(v2, v1); - ::into_response(v3) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml index 3e9abf7b4..7d1f73d10 100644 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_802eb683 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/src/lib.rs index 1e5bc432f..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/src/lib.rs @@ -1,167 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint(url_params).await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a, 'b>( - s_0: pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a, 'b>( - s_0: pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: pavex::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = crate::route_0::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::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = as core::clone::Clone>::clone(&v0); - let v2 = app_802eb683::b(v1); - let v3 = app_802eb683::handler(&v0, v2); - ::into_response(v3) - } - struct Next0<'a, 'b, T> - where - T: std::future::Future, - { - s_0: pavex::request::path::RawPathParams<'a, 'b>, - next: fn(pavex::request::path::RawPathParams<'a, 'b>) -> T, - } - impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml index b148aa81f..31bf92b36 100644 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_d2e8db7a = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/src/lib.rs index 79f5716cc..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/src/lib.rs @@ -1,160 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_d2e8db7a::A, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_d2e8db7a::a(); - crate::ApplicationState { s0: v0 } -} -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("/home", 0u32).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_1::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::GET => { - route_0::entrypoint(server_state.application_state.s0.clone()).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint(s_0: app_d2e8db7a::A) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1(s_0: app_d2e8db7a::A) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: app_d2e8db7a::A) -> pavex::response::Response { - let v1 = crate::route_0::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: app_d2e8db7a::A) -> pavex::response::Response { - let v1 = ::clone(&v0); - let v2 = app_d2e8db7a::b(v1); - let v3 = app_d2e8db7a::handler(&v0, v2); - ::into_response(v3) - } - struct Next0 - where - T: std::future::Future, - { - s_0: app_d2e8db7a::A, - next: fn(app_d2e8db7a::A) -> 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)(self.s_0) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml index 0c8389eaa..c53cf52b8 100644 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_835fd2b1 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs index 01feccd1a..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs @@ -1,155 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_835fd2b1::a(); - let v1 = ::clone(&v0); - let v2 = app_835fd2b1::b(v1); - let v3 = app_835fd2b1::handler(&v0, v2); - ::into_response(v3) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml index 913115aa7..a318a759b 100644 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_2546f91e = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/src/lib.rs index 48333e9c3..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/src/lib.rs @@ -1,154 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_2546f91e::a(); - let v1 = app_2546f91e::b(v0); - let v2 = app_2546f91e::handler(&v0, v1); - ::into_response(v2) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml index cd447a82f..9d49a5d00 100644 --- a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml +++ b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_01492b3d = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs index e62b4100a..e69de29bb 100644 --- a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs +++ b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs @@ -1,219 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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 = wrapping_1().await; - response - } - async fn stage_2<'a>(s_0: &'a app_01492b3d::A) -> pavex::response::Response { - let response = handler(s_0).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 wrapping_1() -> pavex::response::Response { - let v0 = app_01492b3d::a(); - let v1 = crate::route_0::Next1 { - s_0: &v0, - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = ::clone(&v0); - let v4 = app_01492b3d::mw(v3, v2); - ::into_response(v4) - } - async fn handler(v0: &app_01492b3d::A) -> pavex::response::Response { - let v1 = app_01492b3d::handler(v0); - ::into_response(v1) - } - 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)() - } - } - struct Next1<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_01492b3d::A, - next: fn(&'a app_01492b3d::A) -> T, - } - impl<'a, T> std::future::IntoFuture for Next1<'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) - } - } -} -pub mod route_1 { - 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 = wrapping_1(s_0).await; - response - } - async fn stage_2<'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_1::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 wrapping_1( - v0: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v1 = crate::route_1::Next1 { - s_0: v0, - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_01492b3d::a(); - let v4 = app_01492b3d::mw(v3, v2); - ::into_response(v4) - } - 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) - } - } - struct Next1<'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 Next1<'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) - } - } -} diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml index 522ba6736..134aa99ee 100644 --- a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml +++ b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_56967fe8 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/src/lib.rs b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/src/lib.rs index aa774d7d2..e69de29bb 100644 --- a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/src/lib.rs +++ b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/src/lib.rs @@ -1,150 +0,0 @@ -//! 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("/route", 0u32).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 connection_info = connection_info - .expect("Required ConnectionInfo is missing"); - return route_1::entrypoint(&connection_info).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::GET => route_0::entrypoint().await, - _ => { - let connection_info = connection_info - .expect("Required ConnectionInfo is missing"); - route_1::entrypoint(&connection_info).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_56967fe8::root(); - ::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<'a>( - s_0: &'a pavex::connection::ConnectionInfo, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>( - s_0: &'a pavex::connection::ConnectionInfo, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: &pavex::connection::ConnectionInfo, - ) -> pavex::response::Response { - let v1 = crate::route_1::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::connection::ConnectionInfo, - ) -> pavex::response::Response { - let v1 = app_56967fe8::get_connection_info(v0); - ::into_response(v1) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a pavex::connection::ConnectionInfo, - next: fn(&'a pavex::connection::ConnectionInfo) -> 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) - } - } -} diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml index e553f1aa7..45a6950cc 100644 --- a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml +++ b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_a1f930e1 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/src/lib.rs b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/src/lib.rs index b29378fc5..e69de29bb 100644 --- a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/src/lib.rs +++ b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/src/lib.rs @@ -1,166 +0,0 @@ -//! 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("/", 0u32).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_1::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::GET => { - let connection_info = connection_info - .expect("Required ConnectionInfo is missing"); - route_0::entrypoint(&connection_info).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>( - s_0: &'a pavex::connection::ConnectionInfo, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>( - s_0: &'a pavex::connection::ConnectionInfo, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: &pavex::connection::ConnectionInfo, - ) -> pavex::response::Response { - let v1 = crate::route_0::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::connection::ConnectionInfo, - ) -> pavex::response::Response { - let v1 = app_a1f930e1::get_connection_info(v0); - ::into_response(v1) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a pavex::connection::ConnectionInfo, - next: fn(&'a pavex::connection::ConnectionInfo) -> 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) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml index c67d8bba9..bf6dfab12 100644 --- a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml +++ b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_366b29bf = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/src/lib.rs index 3ca5bc120..e69de29bb 100644 --- a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/src/lib.rs +++ b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/src/lib.rs @@ -1,237 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_366b29bf::Singleton, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_366b29bf::Singleton::new(); - crate::ApplicationState { s0: v0 } -} -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("/", 0u32).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_1::entrypoint( - server_state.application_state.s0.clone(), - &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::GET => { - route_0::entrypoint(server_state.application_state.s0.clone()).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint( - server_state.application_state.s0.clone(), - &allowed_methods, - ) - .await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint(s_0: app_366b29bf::Singleton) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1(s_0: app_366b29bf::Singleton) -> pavex::response::Response { - let response = wrapping_1(s_0).await; - response - } - async fn stage_2(s_0: app_366b29bf::Singleton) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: app_366b29bf::Singleton) -> pavex::response::Response { - let v1 = crate::route_0::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 wrapping_1(v0: app_366b29bf::Singleton) -> pavex::response::Response { - let v1 = ::clone(&v0); - let v2 = crate::route_0::Next1 { - s_0: v0, - next: stage_2, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = app_366b29bf::mw(v1, v3); - ::into_response(v4) - } - async fn handler(v0: app_366b29bf::Singleton) -> pavex::response::Response { - let v1 = app_366b29bf::handler(v0); - ::into_response(v1) - } - struct Next0 - where - T: std::future::Future, - { - s_0: app_366b29bf::Singleton, - next: fn(app_366b29bf::Singleton) -> 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)(self.s_0) - } - } - struct Next1 - where - T: std::future::Future, - { - s_0: app_366b29bf::Singleton, - next: fn(app_366b29bf::Singleton) -> T, - } - impl std::future::IntoFuture for Next1 - where - T: std::future::Future, - { - type Output = pavex::response::Response; - type IntoFuture = T; - fn into_future(self) -> Self::IntoFuture { - (self.next)(self.s_0) - } - } -} -pub mod route_1 { - pub async fn entrypoint<'a>( - s_0: app_366b29bf::Singleton, - s_1: &'a pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let response = wrapping_0(s_0, s_1).await; - response - } - async fn stage_1<'a>( - s_0: &'a pavex::router::AllowedMethods, - s_1: app_366b29bf::Singleton, - ) -> pavex::response::Response { - let response = wrapping_1(s_1, s_0).await; - response - } - async fn stage_2<'a>( - s_0: &'a pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: app_366b29bf::Singleton, - v1: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v2 = crate::route_1::Next0 { - s_0: v1, - s_1: v0, - next: stage_1, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = pavex::middleware::wrap_noop(v3).await; - ::into_response(v4) - } - async fn wrapping_1( - v0: app_366b29bf::Singleton, - v1: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v2 = crate::route_1::Next1 { - s_0: v1, - next: stage_2, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = app_366b29bf::mw(v0, v3); - ::into_response(v4) - } - 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, - s_1: app_366b29bf::Singleton, - next: fn(&'a pavex::router::AllowedMethods, app_366b29bf::Singleton) -> 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, self.s_1) - } - } - struct Next1<'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 Next1<'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) - } - } -} diff --git a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml index 6ad7147d0..9fb448416 100644 --- a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml +++ b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_40ab089d = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/src/lib.rs index 8396098f6..e69de29bb 100644 --- a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/src/lib.rs +++ b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/src/lib.rs @@ -1,289 +0,0 @@ -//! 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("/", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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 = wrapping_1().await; - response - } - async fn stage_2(s_0: app_40ab089d::Scoped) -> pavex::response::Response { - let response = wrapping_2(s_0).await; - response - } - async fn stage_3(s_0: app_40ab089d::Scoped) -> pavex::response::Response { - let response = handler(s_0).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 wrapping_1() -> pavex::response::Response { - let v0 = app_40ab089d::Scoped::new(); - let v1 = ::clone(&v0); - let v2 = crate::route_0::Next1 { - s_0: v0, - next: stage_2, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = app_40ab089d::mw(v1, v3); - ::into_response(v4) - } - async fn wrapping_2(v0: app_40ab089d::Scoped) -> pavex::response::Response { - let v1 = ::clone(&v0); - let v2 = crate::route_0::Next2 { - s_0: v1, - next: stage_3, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = app_40ab089d::mw2(&v0, v3); - ::into_response(v4) - } - async fn handler(v0: app_40ab089d::Scoped) -> pavex::response::Response { - let v1 = app_40ab089d::handler(v0); - ::into_response(v1) - } - 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)() - } - } - struct Next1 - where - T: std::future::Future, - { - s_0: app_40ab089d::Scoped, - next: fn(app_40ab089d::Scoped) -> T, - } - impl std::future::IntoFuture for Next1 - where - T: std::future::Future, - { - type Output = pavex::response::Response; - type IntoFuture = T; - fn into_future(self) -> Self::IntoFuture { - (self.next)(self.s_0) - } - } - struct Next2 - where - T: std::future::Future, - { - s_0: app_40ab089d::Scoped, - next: fn(app_40ab089d::Scoped) -> T, - } - impl std::future::IntoFuture for Next2 - where - T: std::future::Future, - { - type Output = pavex::response::Response; - type IntoFuture = T; - fn into_future(self) -> Self::IntoFuture { - (self.next)(self.s_0) - } - } -} -pub mod route_1 { - 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 = wrapping_1(s_0).await; - response - } - async fn stage_2<'a, 'b>( - s_0: &'a pavex::router::AllowedMethods, - s_1: &'b app_40ab089d::Scoped, - ) -> pavex::response::Response { - let response = wrapping_2(s_0, s_1).await; - response - } - async fn stage_3<'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_1::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 wrapping_1( - v0: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v1 = app_40ab089d::Scoped::new(); - let v2 = crate::route_1::Next1 { - s_0: v0, - s_1: &v1, - next: stage_2, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = ::clone(&v1); - let v5 = app_40ab089d::mw(v4, v3); - ::into_response(v5) - } - async fn wrapping_2( - v0: &pavex::router::AllowedMethods, - v1: &app_40ab089d::Scoped, - ) -> pavex::response::Response { - let v2 = crate::route_1::Next2 { - s_0: v0, - next: stage_3, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = app_40ab089d::mw2(v1, v3); - ::into_response(v4) - } - 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) - } - } - struct Next1<'a, 'b, T> - where - T: std::future::Future, - { - s_0: &'a pavex::router::AllowedMethods, - s_1: &'b app_40ab089d::Scoped, - next: fn(&'a pavex::router::AllowedMethods, &'b app_40ab089d::Scoped) -> T, - } - impl<'a, 'b, T> std::future::IntoFuture for Next1<'a, 'b, 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, self.s_1) - } - } - struct Next2<'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 Next2<'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) - } - } -} diff --git a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml index 30d0461db..eee59c826 100644 --- a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml +++ b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_ddc3d7f1 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/src/lib.rs index 1537b95a8..e69de29bb 100644 --- a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/src/lib.rs +++ b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/src/lib.rs @@ -1,161 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_ddc3d7f1::A, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_ddc3d7f1::A::new(); - crate::ApplicationState { s0: v0 } -} -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("/", 0u32).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_1::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::GET => { - route_0::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>(s_0: &'a app_ddc3d7f1::A) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>(s_0: &'a app_ddc3d7f1::A) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: &app_ddc3d7f1::A) -> pavex::response::Response { - let v1 = crate::route_0::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: &app_ddc3d7f1::A) -> pavex::response::Response { - let v2 = { - let v1 = app_ddc3d7f1::Generic::new(v0); - app_ddc3d7f1::handler::(v1) - }; - ::into_response(v2) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_ddc3d7f1::A, - next: fn(&'a app_ddc3d7f1::A) -> 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) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml index 74a40b2bf..1b2e21a60 100644 --- a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml +++ b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_8b5f0867 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/src/lib.rs index 669ab5ef5..e69de29bb 100644 --- a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/src/lib.rs +++ b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/src/lib.rs @@ -1,261 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_8b5f0867::Singleton, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_8b5f0867::Singleton::new(); - crate::ApplicationState { s0: v0 } -} -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("/", 0u32).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_1::entrypoint( - &allowed_methods, - &server_state.application_state.s0, - ) - .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::GET => { - route_0::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint( - &allowed_methods, - &server_state.application_state.s0, - ) - .await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>( - s_0: &'a app_8b5f0867::Singleton, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>(s_0: &'a app_8b5f0867::Singleton) -> pavex::response::Response { - let response = wrapping_1(s_0).await; - response - } - async fn stage_2<'a>( - s_0: &'a app_8b5f0867::RequestScoped, - ) -> pavex::response::Response { - let response = handler(s_0).await; - let response = post_processing_0(response, s_0).await; - response - } - async fn wrapping_0(v0: &app_8b5f0867::Singleton) -> pavex::response::Response { - let v1 = crate::route_0::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 wrapping_1(v0: &app_8b5f0867::Singleton) -> pavex::response::Response { - let v1 = app_8b5f0867::request_scoped(v0); - let v2 = crate::route_0::Next1 { - s_0: &v1, - next: stage_2, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = app_8b5f0867::wrap(v3); - ::into_response(v4) - } - async fn handler(v0: &app_8b5f0867::RequestScoped) -> pavex::response::Response { - let v1 = app_8b5f0867::handler(v0); - ::into_response(v1) - } - async fn post_processing_0( - v0: pavex::response::Response, - v1: &app_8b5f0867::RequestScoped, - ) -> pavex::response::Response { - let v2 = app_8b5f0867::post(v0, v1); - ::into_response(v2) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_8b5f0867::Singleton, - next: fn(&'a app_8b5f0867::Singleton) -> 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) - } - } - struct Next1<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_8b5f0867::RequestScoped, - next: fn(&'a app_8b5f0867::RequestScoped) -> T, - } - impl<'a, T> std::future::IntoFuture for Next1<'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) - } - } -} -pub mod route_1 { - pub async fn entrypoint<'a, 'b>( - s_0: &'a pavex::router::AllowedMethods, - s_1: &'b app_8b5f0867::Singleton, - ) -> pavex::response::Response { - let response = wrapping_0(s_0, s_1).await; - response - } - async fn stage_1<'a, 'b>( - s_0: &'a app_8b5f0867::Singleton, - s_1: &'b pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let response = wrapping_1(s_1, s_0).await; - response - } - async fn stage_2<'a, 'b>( - s_0: &'a app_8b5f0867::Singleton, - s_1: &'b pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let response = handler(s_1).await; - let response = post_processing_0(response, s_0).await; - response - } - async fn wrapping_0( - v0: &pavex::router::AllowedMethods, - v1: &app_8b5f0867::Singleton, - ) -> pavex::response::Response { - let v2 = crate::route_1::Next0 { - s_0: v1, - s_1: v0, - next: stage_1, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = pavex::middleware::wrap_noop(v3).await; - ::into_response(v4) - } - async fn wrapping_1( - v0: &pavex::router::AllowedMethods, - v1: &app_8b5f0867::Singleton, - ) -> pavex::response::Response { - let v2 = crate::route_1::Next1 { - s_0: v1, - s_1: v0, - next: stage_2, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = app_8b5f0867::wrap(v3); - ::into_response(v4) - } - async fn handler(v0: &pavex::router::AllowedMethods) -> pavex::response::Response { - let v1 = pavex::router::default_fallback(v0).await; - ::into_response(v1) - } - async fn post_processing_0( - v0: pavex::response::Response, - v1: &app_8b5f0867::Singleton, - ) -> pavex::response::Response { - let v2 = app_8b5f0867::request_scoped(v1); - let v3 = app_8b5f0867::post(v0, &v2); - ::into_response(v3) - } - struct Next0<'a, 'b, T> - where - T: std::future::Future, - { - s_0: &'a app_8b5f0867::Singleton, - s_1: &'b pavex::router::AllowedMethods, - next: fn(&'a app_8b5f0867::Singleton, &'b pavex::router::AllowedMethods) -> T, - } - impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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, self.s_1) - } - } - struct Next1<'a, 'b, T> - where - T: std::future::Future, - { - s_0: &'a app_8b5f0867::Singleton, - s_1: &'b pavex::router::AllowedMethods, - next: fn(&'a app_8b5f0867::Singleton, &'b pavex::router::AllowedMethods) -> T, - } - impl<'a, 'b, T> std::future::IntoFuture for Next1<'a, 'b, 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, self.s_1) - } - } -} diff --git a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml index f97db0a20..97e49f5d0 100644 --- a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml +++ b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_c266691d = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/src/lib.rs index 0f47cfc24..e69de29bb 100644 --- a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/src/lib.rs +++ b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/src/lib.rs @@ -1,164 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_c266691d::Singleton, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_c266691d::Singleton::new(); - crate::ApplicationState { s0: v0 } -} -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("/home", 0u32).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_1::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::GET => { - route_0::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>( - s_0: &'a app_c266691d::Singleton, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>(s_0: &'a app_c266691d::Singleton) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: &app_c266691d::Singleton) -> pavex::response::Response { - let v1 = crate::route_0::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: &app_c266691d::Singleton) -> pavex::response::Response { - let v1 = app_c266691d::request_scoped(); - let v3 = { - let v2 = app_c266691d::transient(); - app_c266691d::stream_file(v0, &v1, &v2) - }; - ::into_response(v3) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_c266691d::Singleton, - next: fn(&'a app_c266691d::Singleton) -> 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) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml index 377c26aae..647042ec5 100644 --- a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml +++ b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_00ed62be = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/src/lib.rs index cbcce5a9a..e69de29bb 100644 --- a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/src/lib.rs +++ b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/src/lib.rs @@ -1,166 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_00ed62be::constructor(); - let v1 = match v0 { - Ok(ok) => ok, - Err(v1) => { - return { - let v2 = app_00ed62be::error_handler(&v1); - let v3 = pavex::Error::new(v1); - app_00ed62be::error_observer(&v3); - ::into_response( - v2, - ) - }; - } - }; - let v2 = app_00ed62be::handler(v1); - ::into_response(v2) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml index 297917791..571db8ede 100644 --- a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml +++ b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_028e5d85 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/src/lib.rs index ba2b44a4e..e69de29bb 100644 --- a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/src/lib.rs +++ b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/src/lib.rs @@ -1,190 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_028e5d85::A, -} -#[derive(Debug, thiserror::Error)] -pub enum ApplicationStateError { - #[error(transparent)] - A(app_028e5d85::AnError), -} -pub async fn build_application_state() -> Result< - crate::ApplicationState, - crate::ApplicationStateError, -> { - let v0 = app_028e5d85::a(); - let v1 = match v0 { - Ok(ok) => ok, - Err(v1) => { - return { - let v2 = crate::ApplicationStateError::A(v1); - core::result::Result::Err(v2) - }; - } - }; - let v2 = crate::ApplicationState { s0: v1 }; - core::result::Result::Ok(v2) -} -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("/home", 0u32).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_1::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::GET => { - route_0::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>(s_0: &'a app_028e5d85::A) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>(s_0: &'a app_028e5d85::A) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: &app_028e5d85::A) -> pavex::response::Response { - let v1 = crate::route_0::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: &app_028e5d85::A) -> pavex::response::Response { - let v1 = app_028e5d85::b(v0); - let v2 = match v1 { - Ok(ok) => ok, - Err(v2) => { - return { - let v3 = app_028e5d85::error_handler(v0, &v2); - let v4 = pavex::Error::new(v2); - app_028e5d85::error_observer(v0, &v4); - ::into_response( - v3, - ) - }; - } - }; - let v3 = app_028e5d85::handler(&v2); - ::into_response(v3) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_028e5d85::A, - next: fn(&'a app_028e5d85::A) -> 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) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml index 2b3cbc960..25824c51d 100644 --- a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml +++ b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_0ca8edfa = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/src/lib.rs index 782293735..e69de29bb 100644 --- a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/src/lib.rs +++ b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/src/lib.rs @@ -1,170 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_0ca8edfa::a(); - let v1 = app_0ca8edfa::b(&v0); - let v2 = match v1 { - Ok(ok) => ok, - Err(v2) => { - return { - let v3 = app_0ca8edfa::error_handler(&v0, &v2); - let v4 = pavex::Error::new(v2); - { - app_0ca8edfa::error_observer(v0, &v4); - app_0ca8edfa::error_observer2(&v4) - }; - ::into_response( - v3, - ) - }; - } - }; - let v3 = app_0ca8edfa::handler(&v2); - ::into_response(v3) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml index 1812c9259..78384d939 100644 --- a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml +++ b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_e628417e = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/src/lib.rs b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/src/lib.rs index 518196723..e69de29bb 100644 --- a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/src/lib.rs +++ b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/src/lib.rs @@ -1,652 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_e628417e::Spy, -} -pub async fn build_application_state(v0: app_e628417e::Spy) -> crate::ApplicationState { - crate::ApplicationState { s0: v0 } -} -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("/after_handler", 0u32).unwrap(); - router.insert("/early_return", 1u32).unwrap(); - router.insert("/nested", 2u32).unwrap(); - router.insert("/top_level", 3u32).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_0::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::GET => { - route_3::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_0::entrypoint(&allowed_methods).await - } - } - } - 1u32 => { - match &request_head.method { - &pavex::http::Method::GET => { - route_2::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_0::entrypoint(&allowed_methods).await - } - } - } - 2u32 => { - match &request_head.method { - &pavex::http::Method::GET => { - route_1::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_0::entrypoint(&allowed_methods).await - } - } - } - 3u32 => { - match &request_head.method { - &pavex::http::Method::GET => { - route_4::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_0::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - 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_0::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) - } - } -} -pub mod route_1 { - pub async fn entrypoint<'a>( - s_0: &'a app_e628417e::Spy, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { - let response = wrapping_1(s_0).await; - response - } - async fn stage_2<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { - if let Some(response) = pre_processing_0(s_0).await.into_response() { - return response; - } - let response = wrapping_2(s_0).await; - let response = post_processing_1(response, s_0).await; - response - } - async fn stage_3<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { - if let Some(response) = pre_processing_1(s_0).await.into_response() { - return response; - } - let response = handler(s_0).await; - let response = post_processing_0(response, s_0).await; - response - } - async fn wrapping_0(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = crate::route_1::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 wrapping_1(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = crate::route_1::Next1 { - s_0: v0, - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_e628417e::first(v0, v2).await; - ::into_response(v3) - } - async fn pre_processing_0( - v0: &app_e628417e::Spy, - ) -> pavex::middleware::Processing { - app_e628417e::first_pre(v0).await - } - async fn wrapping_2(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = crate::route_1::Next2 { - s_0: v0, - next: stage_3, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_e628417e::second(v0, v2).await; - ::into_response(v3) - } - async fn pre_processing_1( - v0: &app_e628417e::Spy, - ) -> pavex::middleware::Processing { - app_e628417e::second_pre(v0).await - } - async fn handler(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = app_e628417e::handler(v0).await; - ::into_response(v1) - } - async fn post_processing_0( - v0: pavex::response::Response, - v1: &app_e628417e::Spy, - ) -> pavex::response::Response { - let v2 = app_e628417e::second_post(v1, v0).await; - ::into_response(v2) - } - async fn post_processing_1( - v0: pavex::response::Response, - v1: &app_e628417e::Spy, - ) -> pavex::response::Response { - let v2 = app_e628417e::first_post(v1, v0).await; - ::into_response(v2) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_e628417e::Spy, - next: fn(&'a app_e628417e::Spy) -> 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) - } - } - struct Next1<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_e628417e::Spy, - next: fn(&'a app_e628417e::Spy) -> T, - } - impl<'a, T> std::future::IntoFuture for Next1<'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) - } - } - struct Next2<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_e628417e::Spy, - next: fn(&'a app_e628417e::Spy) -> T, - } - impl<'a, T> std::future::IntoFuture for Next2<'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) - } - } -} -pub mod route_2 { - pub async fn entrypoint<'a>( - s_0: &'a app_e628417e::Spy, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { - let response = wrapping_1(s_0).await; - response - } - async fn stage_2<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { - if let Some(response) = pre_processing_0(s_0).await.into_response() { - return response; - } - let response = wrapping_2(s_0).await; - let response = post_processing_1(response, s_0).await; - response - } - async fn stage_3<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { - if let Some(response) = pre_processing_1(s_0).await.into_response() { - return response; - } - let response = handler(s_0).await; - let response = post_processing_0(response, s_0).await; - response - } - async fn wrapping_0(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = crate::route_2::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 wrapping_1(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = crate::route_2::Next1 { - s_0: v0, - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_e628417e::first(v0, v2).await; - ::into_response(v3) - } - async fn pre_processing_0( - v0: &app_e628417e::Spy, - ) -> pavex::middleware::Processing { - app_e628417e::early_return_pre(v0).await - } - async fn wrapping_2(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = crate::route_2::Next2 { - s_0: v0, - next: stage_3, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_e628417e::second(v0, v2).await; - ::into_response(v3) - } - async fn pre_processing_1( - v0: &app_e628417e::Spy, - ) -> pavex::middleware::Processing { - app_e628417e::second_pre(v0).await - } - async fn handler(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = app_e628417e::handler(v0).await; - ::into_response(v1) - } - async fn post_processing_0( - v0: pavex::response::Response, - v1: &app_e628417e::Spy, - ) -> pavex::response::Response { - let v2 = app_e628417e::second_post(v1, v0).await; - ::into_response(v2) - } - async fn post_processing_1( - v0: pavex::response::Response, - v1: &app_e628417e::Spy, - ) -> pavex::response::Response { - let v2 = app_e628417e::first_post(v1, v0).await; - ::into_response(v2) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_e628417e::Spy, - next: fn(&'a app_e628417e::Spy) -> 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) - } - } - struct Next1<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_e628417e::Spy, - next: fn(&'a app_e628417e::Spy) -> T, - } - impl<'a, T> std::future::IntoFuture for Next1<'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) - } - } - struct Next2<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_e628417e::Spy, - next: fn(&'a app_e628417e::Spy) -> T, - } - impl<'a, T> std::future::IntoFuture for Next2<'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) - } - } -} -pub mod route_3 { - pub async fn entrypoint<'a>( - s_0: &'a app_e628417e::Spy, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { - let response = wrapping_1(s_0).await; - response - } - async fn stage_2<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { - if let Some(response) = pre_processing_0(s_0).await.into_response() { - return response; - } - let response = handler(s_0).await; - let response = post_processing_0(response, s_0).await; - response - } - async fn wrapping_0(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = crate::route_3::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 wrapping_1(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = crate::route_3::Next1 { - s_0: v0, - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_e628417e::first(v0, v2).await; - ::into_response(v3) - } - async fn pre_processing_0( - v0: &app_e628417e::Spy, - ) -> pavex::middleware::Processing { - app_e628417e::first_pre(v0).await - } - async fn handler(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = app_e628417e::handler(v0).await; - ::into_response(v1) - } - async fn post_processing_0( - v0: pavex::response::Response, - v1: &app_e628417e::Spy, - ) -> pavex::response::Response { - let v2 = app_e628417e::first_post(v1, v0).await; - ::into_response(v2) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_e628417e::Spy, - next: fn(&'a app_e628417e::Spy) -> 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) - } - } - struct Next1<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_e628417e::Spy, - next: fn(&'a app_e628417e::Spy) -> T, - } - impl<'a, T> std::future::IntoFuture for Next1<'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) - } - } -} -pub mod route_4 { - pub async fn entrypoint<'a>( - s_0: &'a app_e628417e::Spy, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { - let response = wrapping_1(s_0).await; - response - } - async fn stage_2<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { - let response = wrapping_2(s_0).await; - response - } - async fn stage_3<'a>(s_0: &'a app_e628417e::Spy) -> pavex::response::Response { - if let Some(response) = pre_processing_0(s_0).await.into_response() { - return response; - } - if let Some(response) = pre_processing_1(s_0).await.into_response() { - return response; - } - let response = handler(s_0).await; - let response = post_processing_0(response, s_0).await; - let response = post_processing_1(response, s_0).await; - response - } - async fn wrapping_0(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = crate::route_4::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 wrapping_1(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = crate::route_4::Next1 { - s_0: v0, - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_e628417e::first(v0, v2).await; - ::into_response(v3) - } - async fn wrapping_2(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = crate::route_4::Next2 { - s_0: v0, - next: stage_3, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_e628417e::second(v0, v2).await; - ::into_response(v3) - } - async fn pre_processing_0( - v0: &app_e628417e::Spy, - ) -> pavex::middleware::Processing { - app_e628417e::first_pre(v0).await - } - async fn pre_processing_1( - v0: &app_e628417e::Spy, - ) -> pavex::middleware::Processing { - app_e628417e::second_pre(v0).await - } - async fn handler(v0: &app_e628417e::Spy) -> pavex::response::Response { - let v1 = app_e628417e::handler(v0).await; - ::into_response(v1) - } - async fn post_processing_0( - v0: pavex::response::Response, - v1: &app_e628417e::Spy, - ) -> pavex::response::Response { - let v2 = app_e628417e::first_post(v1, v0).await; - ::into_response(v2) - } - async fn post_processing_1( - v0: pavex::response::Response, - v1: &app_e628417e::Spy, - ) -> pavex::response::Response { - let v2 = app_e628417e::second_post(v1, v0).await; - ::into_response(v2) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_e628417e::Spy, - next: fn(&'a app_e628417e::Spy) -> 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) - } - } - struct Next1<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_e628417e::Spy, - next: fn(&'a app_e628417e::Spy) -> T, - } - impl<'a, T> std::future::IntoFuture for Next1<'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) - } - } - struct Next2<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_e628417e::Spy, - next: fn(&'a app_e628417e::Spy) -> T, - } - impl<'a, T> std::future::IntoFuture for Next2<'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) - } - } -} diff --git a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml index 4bf7b76e1..007cb731e 100644 --- a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml +++ b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_dc1710a5 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/src/lib.rs b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/src/lib.rs index 276176a4b..e69de29bb 100644 --- a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/src/lib.rs +++ b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/src/lib.rs @@ -1,230 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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 = wrapping_1().await; - response - } - async fn stage_2<'a, 'b>( - s_0: &'a app_dc1710a5::C, - s_1: &'b app_dc1710a5::A, - ) -> pavex::response::Response { - let response = handler(s_0, s_1).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 wrapping_1() -> pavex::response::Response { - let v0 = app_dc1710a5::c(); - let v1 = app_dc1710a5::a(); - let v2 = app_dc1710a5::b(&v1, &v0); - let v3 = crate::route_0::Next1 { - s_0: &v0, - s_1: &v1, - next: stage_2, - }; - let v4 = pavex::middleware::Next::new(v3); - let v5 = app_dc1710a5::mw(v4, v2); - ::into_response(v5) - } - async fn handler( - v0: &app_dc1710a5::C, - v1: &app_dc1710a5::A, - ) -> pavex::response::Response { - let v2 = app_dc1710a5::handler(v1, v0); - ::into_response(v2) - } - 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)() - } - } - struct Next1<'a, 'b, T> - where - T: std::future::Future, - { - s_0: &'a app_dc1710a5::C, - s_1: &'b app_dc1710a5::A, - next: fn(&'a app_dc1710a5::C, &'b app_dc1710a5::A) -> T, - } - impl<'a, 'b, T> std::future::IntoFuture for Next1<'a, 'b, 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, self.s_1) - } - } -} -pub mod route_1 { - 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 = wrapping_1(s_0).await; - response - } - async fn stage_2<'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_1::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 wrapping_1( - v0: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v1 = app_dc1710a5::c(); - let v2 = app_dc1710a5::a(); - let v3 = app_dc1710a5::b(&v2, &v1); - let v4 = crate::route_1::Next1 { - s_0: v0, - next: stage_2, - }; - let v5 = pavex::middleware::Next::new(v4); - let v6 = app_dc1710a5::mw(v5, v3); - ::into_response(v6) - } - 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) - } - } - struct Next1<'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 Next1<'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) - } - } -} diff --git a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml index 5726b199d..c578c85a9 100644 --- a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml +++ b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_db1cbdff = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/src/lib.rs b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/src/lib.rs index a04e9a270..e69de29bb 100644 --- a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/src/lib.rs +++ b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/src/lib.rs @@ -1,235 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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(mut s_0: app_db1cbdff::A) -> pavex::response::Response { - let response = wrapping_1(&mut s_0).await; - let response = post_processing_0(s_0, response).await; - response - } - async fn stage_2<'a>(s_0: &'a mut app_db1cbdff::A) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0() -> pavex::response::Response { - let v0 = app_db1cbdff::a(); - let v1 = crate::route_0::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 wrapping_1(v0: &mut app_db1cbdff::A) -> pavex::response::Response { - let v1 = crate::route_0::Next1 { - s_0: v0, - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_db1cbdff::mw(v2); - ::into_response(v3) - } - async fn handler(v0: &mut app_db1cbdff::A) -> pavex::response::Response { - let v1 = app_db1cbdff::handler(v0); - ::into_response(v1) - } - async fn post_processing_0( - v0: app_db1cbdff::A, - v1: pavex::response::Response, - ) -> pavex::response::Response { - let v2 = app_db1cbdff::post(v0, v1); - ::into_response(v2) - } - struct Next0 - where - T: std::future::Future, - { - s_0: app_db1cbdff::A, - next: fn(app_db1cbdff::A) -> 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)(self.s_0) - } - } - struct Next1<'a, T> - where - T: std::future::Future, - { - s_0: &'a mut app_db1cbdff::A, - next: fn(&'a mut app_db1cbdff::A) -> T, - } - impl<'a, T> std::future::IntoFuture for Next1<'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) - } - } -} -pub mod route_1 { - 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 = wrapping_1(s_0).await; - let response = post_processing_0(response).await; - response - } - async fn stage_2<'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_1::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 wrapping_1( - v0: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v1 = crate::route_1::Next1 { - s_0: v0, - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_db1cbdff::mw(v2); - ::into_response(v3) - } - async fn handler(v0: &pavex::router::AllowedMethods) -> pavex::response::Response { - let v1 = pavex::router::default_fallback(v0).await; - ::into_response(v1) - } - async fn post_processing_0( - v0: pavex::response::Response, - ) -> pavex::response::Response { - let v1 = app_db1cbdff::a(); - let v2 = app_db1cbdff::post(v1, v0); - ::into_response(v2) - } - 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) - } - } - struct Next1<'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 Next1<'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) - } - } -} diff --git a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml index 395f29e33..e7971300a 100644 --- a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml +++ b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_4b6f5359 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/src/lib.rs b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/src/lib.rs index 7949a62bf..e69de29bb 100644 --- a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/src/lib.rs +++ b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/src/lib.rs @@ -1,254 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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(s_0: app_4b6f5359::A) -> pavex::response::Response { - if let Some(response) = pre_processing_0(&s_0).await.into_response() { - return response; - } - let response = wrapping_1(&s_0).await; - let response = post_processing_0(response, s_0).await; - response - } - async fn stage_2() -> pavex::response::Response { - let response = handler().await; - response - } - async fn wrapping_0() -> pavex::response::Response { - let v0 = app_4b6f5359::a(); - let v1 = crate::route_0::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 pre_processing_0( - v0: &app_4b6f5359::A, - ) -> pavex::middleware::Processing { - app_4b6f5359::pre(v0) - } - async fn wrapping_1(v0: &app_4b6f5359::A) -> pavex::response::Response { - let v1 = crate::route_0::Next1 { - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_4b6f5359::wrap(v2, v0); - ::into_response(v3) - } - async fn handler() -> pavex::response::Response { - let v0 = app_4b6f5359::handler(); - ::into_response(v0) - } - async fn post_processing_0( - v0: pavex::response::Response, - v1: app_4b6f5359::A, - ) -> pavex::response::Response { - let v2 = app_4b6f5359::post(v0, v1); - ::into_response(v2) - } - struct Next0 - where - T: std::future::Future, - { - s_0: app_4b6f5359::A, - next: fn(app_4b6f5359::A) -> 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)(self.s_0) - } - } - struct Next1 - where - T: std::future::Future, - { - next: fn() -> T, - } - impl std::future::IntoFuture for Next1 - 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<'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, - s_1: app_4b6f5359::A, - ) -> pavex::response::Response { - if let Some(response) = pre_processing_0(&s_1).await.into_response() { - return response; - } - let response = wrapping_1(s_0, &s_1).await; - let response = post_processing_0(response, s_1).await; - response - } - async fn stage_2<'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 = app_4b6f5359::a(); - let v2 = crate::route_1::Next0 { - s_0: v0, - s_1: v1, - next: stage_1, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = pavex::middleware::wrap_noop(v3).await; - ::into_response(v4) - } - async fn pre_processing_0( - v0: &app_4b6f5359::A, - ) -> pavex::middleware::Processing { - app_4b6f5359::pre(v0) - } - async fn wrapping_1( - v0: &pavex::router::AllowedMethods, - v1: &app_4b6f5359::A, - ) -> pavex::response::Response { - let v2 = crate::route_1::Next1 { - s_0: v0, - next: stage_2, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = app_4b6f5359::wrap(v3, v1); - ::into_response(v4) - } - async fn handler(v0: &pavex::router::AllowedMethods) -> pavex::response::Response { - let v1 = pavex::router::default_fallback(v0).await; - ::into_response(v1) - } - async fn post_processing_0( - v0: pavex::response::Response, - v1: app_4b6f5359::A, - ) -> pavex::response::Response { - let v2 = app_4b6f5359::post(v0, v1); - ::into_response(v2) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a pavex::router::AllowedMethods, - s_1: app_4b6f5359::A, - next: fn(&'a pavex::router::AllowedMethods, app_4b6f5359::A) -> 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, self.s_1) - } - } - struct Next1<'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 Next1<'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) - } - } -} diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml index 749c44e48..7fb6b164d 100644 --- a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml +++ b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_c1ac8ad4 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/src/lib.rs b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/src/lib.rs index a1f29db4f..e69de29bb 100644 --- a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/src/lib.rs +++ b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/src/lib.rs @@ -1,326 +0,0 @@ -//! 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("/home/:home_id", 0u32).unwrap(); - router.insert("/home/:home_id/room/:room_id", 1u32).unwrap(); - router.insert("/town/*town", 2u32).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_3::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::GET => route_0::entrypoint(url_params).await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_3::entrypoint(&allowed_methods).await - } - } - } - 1u32 => { - match &request_head.method { - &pavex::http::Method::GET => route_1::entrypoint(url_params).await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_3::entrypoint(&allowed_methods).await - } - } - } - 2u32 => { - match &request_head.method { - &pavex::http::Method::GET => route_2::entrypoint(url_params).await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_3::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a, 'b>( - s_0: pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a, 'b>( - s_0: pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: pavex::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = crate::route_0::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::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = pavex::request::path::PathParams::extract(v0); - let v2 = match v1 { - Ok(ok) => ok, - Err(v2) => { - return { - let v3 = pavex::request::path::errors::ExtractPathParamsError::into_response( - &v2, - ); - ::into_response( - v3, - ) - }; - } - }; - let v3 = app_c1ac8ad4::get_home(v2); - ::into_response(v3) - } - struct Next0<'a, 'b, T> - where - T: std::future::Future, - { - s_0: pavex::request::path::RawPathParams<'a, 'b>, - next: fn(pavex::request::path::RawPathParams<'a, 'b>) -> T, - } - impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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) - } - } -} -pub mod route_1 { - pub async fn entrypoint<'a, 'b>( - s_0: pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a, 'b>( - s_0: pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: pavex::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = crate::route_1::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::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = pavex::request::path::PathParams::extract(v0); - let v2 = match v1 { - Ok(ok) => ok, - Err(v2) => { - return { - let v3 = pavex::request::path::errors::ExtractPathParamsError::into_response( - &v2, - ); - ::into_response( - v3, - ) - }; - } - }; - let v3 = app_c1ac8ad4::get_room(v2); - ::into_response(v3) - } - struct Next0<'a, 'b, T> - where - T: std::future::Future, - { - s_0: pavex::request::path::RawPathParams<'a, 'b>, - next: fn(pavex::request::path::RawPathParams<'a, 'b>) -> T, - } - impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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) - } - } -} -pub mod route_2 { - pub async fn entrypoint<'a, 'b>( - s_0: pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a, 'b>( - s_0: pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: pavex::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = crate::route_2::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::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = pavex::request::path::PathParams::extract(v0); - let v2 = match v1 { - Ok(ok) => ok, - Err(v2) => { - return { - let v3 = pavex::request::path::errors::ExtractPathParamsError::into_response( - &v2, - ); - ::into_response( - v3, - ) - }; - } - }; - let v3 = app_c1ac8ad4::get_town(v2); - ::into_response(v3) - } - struct Next0<'a, 'b, T> - where - T: std::future::Future, - { - s_0: pavex::request::path::RawPathParams<'a, 'b>, - next: fn(pavex::request::path::RawPathParams<'a, 'b>) -> T, - } - impl<'a, 'b, T> std::future::IntoFuture for Next0<'a, 'b, 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) - } - } -} -pub mod route_3 { - 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_3::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) - } - } -} diff --git a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml index b1af710d3..9fdf49ac7 100644 --- a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_ca963e92 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/src/lib.rs b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/src/lib.rs index 33ce6dfb9..e69de29bb 100644 --- a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/src/lib.rs @@ -1,152 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_ca963e92::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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml index 94916408b..c1fe0d1c3 100644 --- a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_933292bd = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/src/lib.rs index 52ed88bf2..e69de29bb 100644 --- a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/src/lib.rs @@ -1,166 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: alloc::sync::Arc, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_933292bd::constructor(); - crate::ApplicationState { s0: v0 } -} -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("/", 0u32).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_1::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::GET => { - route_0::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>( - s_0: &'a alloc::sync::Arc, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>( - s_0: &'a alloc::sync::Arc, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: &alloc::sync::Arc, - ) -> pavex::response::Response { - let v1 = crate::route_0::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: &alloc::sync::Arc, - ) -> pavex::response::Response { - let v1 = app_933292bd::handler(v0); - ::into_response(v1) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a alloc::sync::Arc, - next: fn(&'a alloc::sync::Arc) -> 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) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml index 1d9ff00eb..ced7900cc 100644 --- a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_88bca0dc = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/src/lib.rs index 365a823f9..e69de29bb 100644 --- a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/src/lib.rs @@ -1,307 +0,0 @@ -//! 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("/head", 0u32).unwrap(); - router.insert("/parts", 1u32).unwrap(); - router.insert("/response", 2u32).unwrap(); - router.insert("/status_code", 3u32).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_4::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::GET => route_3::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_4::entrypoint(&allowed_methods).await - } - } - } - 1u32 => { - 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_4::entrypoint(&allowed_methods).await - } - } - } - 2u32 => { - match &request_head.method { - &pavex::http::Method::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_4::entrypoint(&allowed_methods).await - } - } - } - 3u32 => { - match &request_head.method { - &pavex::http::Method::GET => route_1::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_4::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_88bca0dc::response(); - ::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_88bca0dc::status_code(); - ::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_88bca0dc::parts(); - ::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_88bca0dc::response_head(); - ::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<'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_4::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) - } - } -} diff --git a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml index 876050836..66a79b9f9 100644 --- a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml @@ -6,12 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_39415e2f = { version = "0.1.0", path = ".." } -dep_39415e2f = { version = "0.1.0", path = "../ephemeral_deps/dep" } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/src/lib.rs index 7e93108ac..e69de29bb 100644 --- a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/src/lib.rs @@ -1,155 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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 v1 = { - let v0 = dep_39415e2f::new_logger(); - app_39415e2f::handler(v0) - }; - ::into_response(v1) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml index a6279044b..af839322a 100644 --- a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml @@ -6,13 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_cb7427d1 = { version = "0.1.0", path = ".." } -http_0_1_21 = { version = "0.1.21", package = "http" } -http_0_2_12 = { version = "0.2.12", package = "http" } -http_1_1_0 = { version = "1.1.0", package = "http" } -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/src/lib.rs index 2e5040404..e69de29bb 100644 --- a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/src/lib.rs @@ -1,154 +0,0 @@ -//! 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("/home", 0u32).unwrap(); - router -} -async fn route_request( - request: http_1_1_0::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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_cb7427d1::header2(); - let v1 = app_cb7427d1::header1(); - let v2 = app_cb7427d1::stream_file(v1, v0); - ::into_response(v2) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml index 2e3ab79bf..d165bfac2 100644 --- a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml @@ -6,13 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -dep_a0f4586a = { version = "0.1.0", path = "../ephemeral_deps/dep" } -http_0_1_21 = { version = "0.1.21", package = "http" } -http_0_2_12 = { version = "0.2.12", package = "http" } -http_1_1_0 = { version = "1.1.0", package = "http" } -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/src/lib.rs index 172e19b1f..e69de29bb 100644 --- a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/src/lib.rs @@ -1,154 +0,0 @@ -//! 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("/handler", 0u32).unwrap(); - router -} -async fn route_request( - request: http_1_1_0::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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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 = dep_a0f4586a::header2(); - let v1 = dep_a0f4586a::header1(); - let v2 = dep_a0f4586a::handler(v1, v0); - ::into_response(v2) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml index c8370b2e2..f5451352f 100644 --- a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_603d81dd = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/src/lib.rs index e0ffd89f6..e69de29bb 100644 --- a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/src/lib.rs @@ -1,153 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_603d81dd::path(); - let v1 = app_603d81dd::stream_file::(v0); - ::into_response(v1) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml index 73bae9357..bb444ad20 100644 --- a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml @@ -6,12 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_dcb9931d = { version = "0.1.0", path = ".." } -dep_dcb9931d = { version = "1.0.0", path = "../ephemeral_deps/dep_1" } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/src/lib.rs b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/src/lib.rs index ea822402d..e69de29bb 100644 --- a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/src/lib.rs @@ -1,154 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_dcb9931d::handler(); - as pavex::response::IntoResponse>::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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml index bbc9ccf5c..a7dc7ef1f 100644 --- a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_d56c0f9d = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/src/lib.rs b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/src/lib.rs index f6aaaf9eb..e69de29bb 100644 --- a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/src/lib.rs @@ -1,230 +0,0 @@ -//! 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("/", 0u32).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_1::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::GET => route_0::entrypoint(&url_params).await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a, 'b, 'c>( - s_0: &'c pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a, 'b, 'c>( - s_0: &'c pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = wrapping_1(s_0).await; - response - } - async fn stage_2<'a, 'b, 'c>( - s_0: &'c pavex::request::path::RawPathParams<'a, 'b>, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: &pavex::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = crate::route_0::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 wrapping_1( - v0: &pavex::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = crate::route_0::Next1 { - s_0: v0, - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_d56c0f9d::mw(v2); - ::into_response(v3) - } - async fn handler( - v0: &pavex::request::path::RawPathParams<'_, '_>, - ) -> pavex::response::Response { - let v1 = app_d56c0f9d::handler(v0); - ::into_response(v1) - } - struct Next0<'a, 'b, 'c, T> - where - T: std::future::Future, - { - s_0: &'c pavex::request::path::RawPathParams<'a, 'b>, - next: fn(&'c pavex::request::path::RawPathParams<'a, 'b>) -> T, - } - impl<'a, 'b, 'c, T> std::future::IntoFuture for Next0<'a, 'b, 'c, 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) - } - } - struct Next1<'a, 'b, 'c, T> - where - T: std::future::Future, - { - s_0: &'c pavex::request::path::RawPathParams<'a, 'b>, - next: fn(&'c pavex::request::path::RawPathParams<'a, 'b>) -> T, - } - impl<'a, 'b, 'c, T> std::future::IntoFuture for Next1<'a, 'b, 'c, 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) - } - } -} -pub mod route_1 { - 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 = wrapping_1(s_0).await; - response - } - async fn stage_2<'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_1::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 wrapping_1( - v0: &pavex::router::AllowedMethods, - ) -> pavex::response::Response { - let v1 = crate::route_1::Next1 { - s_0: v0, - next: stage_2, - }; - let v2 = pavex::middleware::Next::new(v1); - let v3 = app_d56c0f9d::mw(v2); - ::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) - } - } - struct Next1<'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 Next1<'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) - } - } -} diff --git a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml index d0e4c6c71..edee226da 100644 --- a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_e6a3fe43 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/src/lib.rs index cd40660e3..e69de29bb 100644 --- a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/src/lib.rs @@ -1,152 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_e6a3fe43::nested::function(); - ::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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml index 6330846ee..e3f1cd4bb 100644 --- a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_40e90d31 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/src/lib.rs index 5b3bc5a34..e69de29bb 100644 --- a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/src/lib.rs @@ -1,166 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_40e90d31::LoggerFactory, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_40e90d31::LoggerFactory::new(); - crate::ApplicationState { s0: v0 } -} -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("/home", 0u32).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_1::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::GET => { - route_0::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>( - s_0: &'a app_40e90d31::LoggerFactory, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>( - s_0: &'a app_40e90d31::LoggerFactory, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: &app_40e90d31::LoggerFactory) -> pavex::response::Response { - let v1 = crate::route_0::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: &app_40e90d31::LoggerFactory) -> pavex::response::Response { - let v1 = app_40e90d31::Streamer::new(); - let v3 = { - let v2 = app_40e90d31::LoggerFactory::logger(v0); - app_40e90d31::Streamer::stream_file(&v1, v2) - }; - ::into_response(v3) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_40e90d31::LoggerFactory, - next: fn(&'a app_40e90d31::LoggerFactory) -> 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) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml index 087568731..1342b937f 100644 --- a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_d1b695a6 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/src/lib.rs index 3b76fe7b8..e69de29bb 100644 --- a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/src/lib.rs @@ -1,160 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: app_d1b695a6::Streamer, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_d1b695a6::streamer(); - crate::ApplicationState { s0: v0 } -} -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("/home", 0u32).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_1::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::GET => { - route_0::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>( - s_0: &'a app_d1b695a6::Streamer, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>(s_0: &'a app_d1b695a6::Streamer) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: &app_d1b695a6::Streamer) -> pavex::response::Response { - let v1 = crate::route_0::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: &app_d1b695a6::Streamer) -> pavex::response::Response { - let v1 = app_d1b695a6::stream_file(v0); - ::into_response(v1) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a app_d1b695a6::Streamer, - next: fn(&'a app_d1b695a6::Streamer) -> 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) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml index 663e78d6d..8ac477f37 100644 --- a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml @@ -6,12 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_065fd341 = { version = "0.1.0", path = ".." } -dep_065fd341 = { version = "0.1.0", path = "../ephemeral_deps/dep" } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/src/lib.rs b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/src/lib.rs index 00dd58397..e69de29bb 100644 --- a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/src/lib.rs @@ -1,166 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: dep_065fd341::Surreal, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_065fd341::constructor(); - crate::ApplicationState { s0: v0 } -} -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("/", 0u32).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_1::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::GET => { - route_0::entrypoint(&server_state.application_state.s0).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>( - s_0: &'a dep_065fd341::Surreal, - ) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1<'a>( - s_0: &'a dep_065fd341::Surreal, - ) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0( - v0: &dep_065fd341::Surreal, - ) -> pavex::response::Response { - let v1 = crate::route_0::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: &dep_065fd341::Surreal, - ) -> pavex::response::Response { - let v1 = app_065fd341::handler(v0); - ::into_response(v1) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: &'a dep_065fd341::Surreal, - next: fn(&'a dep_065fd341::Surreal) -> 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) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml index 85cfdab2f..7a8f1574d 100644 --- a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_698936eb = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/src/lib.rs index 7efa827a4..e69de29bb 100644 --- a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/src/lib.rs @@ -1,153 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_698936eb::my_mod::A::::new(); - let v1 = app_698936eb::handler(v0); - ::into_response(v1) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml index e9fb0f583..030250b39 100644 --- a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_ec0f16d1 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/src/lib.rs index 9bac962c0..e69de29bb 100644 --- a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/src/lib.rs @@ -1,153 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_ec0f16d1::A::::new(); - let v1 = app_ec0f16d1::handler(v0); - ::into_response(v1) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml index d6eea4380..bf4eedc7f 100644 --- a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml @@ -6,12 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -anyhow = "1.0.87" -app_d89d2d61 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/src/lib.rs index 943c0ae58..e69de29bb 100644 --- a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/src/lib.rs @@ -1,164 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_d89d2d61::A::new(); - let v1 = match v0 { - Ok(ok) => ok, - Err(v1) => { - return { - let v2 = app_d89d2d61::error_handler(&v1); - ::into_response( - v2, - ) - }; - } - }; - let v2 = app_d89d2d61::handler(v1); - ::into_response(v2) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml index 539793169..cbe5a1cbc 100644 --- a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_d50c6d0c = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/src/lib.rs index 16f59205d..e69de29bb 100644 --- a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/src/lib.rs @@ -1,152 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_d50c6d0c::Streamer::stream_file(); - ::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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml index 0cb43c3aa..ac781d582 100644 --- a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_a7fd6a2c = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/src/lib.rs index 55c045569..e69de29bb 100644 --- a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/src/lib.rs @@ -1,165 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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 = ::a_method_that_returns_self(); - let v1 = ::a_method_that_borrows_self( - &v0, - ); - let v2 = ::a_method_that_consumes_self( - v1, - ); - let v3 = >::a_method(&v2); - let v4 = ::a_method_with_a_generic::< - std::string::String, - >(&v0); - let v5 = app_a7fd6a2c::handler(v0, v2, v4, v3); - ::into_response(v5) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml index 23edfbf9c..d65f947ba 100644 --- a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_ecefbcb0 = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/src/lib.rs index 5815de7c3..e69de29bb 100644 --- a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/src/lib.rs @@ -1,156 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_ecefbcb0::b_constructor(); - let v1 = >::a_method_using_the_trait_generic_param(); - let v2 = app_ecefbcb0::handler(v1, v0); - ::into_response(v2) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml index 2eecb5466..eca443ecd 100644 --- a/libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml @@ -6,11 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_1bd0738c = { version = "0.1.0", path = ".." } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/tuples_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/tuples_are_supported/generated_app/src/lib.rs index 4cab3cc66..e69de29bb 100644 --- a/libs/ui_tests/reflection/tuples_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/tuples_are_supported/generated_app/src/lib.rs @@ -1,158 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: (usize, isize), -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_1bd0738c::constructor_with_output_tuple(); - crate::ApplicationState { s0: v0 } -} -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("/home", 0u32).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_1::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::GET => { - route_0::entrypoint(server_state.application_state.s0.clone()).await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint(s_0: (usize, isize)) -> pavex::response::Response { - let response = wrapping_0(s_0).await; - response - } - async fn stage_1(s_0: (usize, isize)) -> pavex::response::Response { - let response = handler(s_0).await; - response - } - async fn wrapping_0(v0: (usize, isize)) -> pavex::response::Response { - let v1 = crate::route_0::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: (usize, isize)) -> pavex::response::Response { - let v1 = app_1bd0738c::handler_with_input_tuple(v0); - ::into_response(v1) - } - struct Next0 - where - T: std::future::Future, - { - s_0: (usize, isize), - next: fn((usize, isize)) -> 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)(self.s_0) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} diff --git a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml index 79599516a..adb53a067 100644 --- a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml +++ b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml @@ -6,12 +6,3 @@ edition = "2021" [package.metadata.px.generate] generator_type = "cargo_workspace_binary" generator_name = "app" - -[dependencies] -app_f8f62968 = { version = "0.1.0", path = ".." } -dep_f8f62968 = { version = "0.1.0", path = "../ephemeral_deps/dep" } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/src/lib.rs index 718bec825..e69de29bb 100644 --- a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/src/lib.rs +++ b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/src/lib.rs @@ -1,181 +0,0 @@ -//! 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, - application_state: ApplicationState, -} -pub struct ApplicationState { - s0: (bool, char, u8), - s1: dep_f8f62968::ActualType, -} -pub async fn build_application_state() -> crate::ApplicationState { - let v0 = app_f8f62968::RemoteAlias::new(); - let v1 = app_f8f62968::constructor_with_output_tuple(); - crate::ApplicationState { - s0: v1, - s1: v0, - } -} -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("/home", 0u32).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_1::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::GET => { - route_0::entrypoint( - server_state.application_state.s0.clone(), - &server_state.application_state.s1, - ) - .await - } - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::entrypoint(&allowed_methods).await - } - } - } - i => unreachable!("Unknown route id: {}", i), - } -} -pub mod route_0 { - pub async fn entrypoint<'a>( - s_0: (bool, char, u8), - s_1: &'a dep_f8f62968::ActualType, - ) -> pavex::response::Response { - let response = wrapping_0(s_0, s_1).await; - response - } - async fn stage_1<'a>( - s_0: (bool, char, u8), - s_1: &'a dep_f8f62968::ActualType, - ) -> pavex::response::Response { - let response = handler(s_0, s_1).await; - response - } - async fn wrapping_0( - v0: (bool, char, u8), - v1: &dep_f8f62968::ActualType, - ) -> pavex::response::Response { - let v2 = crate::route_0::Next0 { - s_0: v0, - s_1: v1, - next: stage_1, - }; - let v3 = pavex::middleware::Next::new(v2); - let v4 = pavex::middleware::wrap_noop(v3).await; - ::into_response(v4) - } - async fn handler( - v0: (bool, char, u8), - v1: &dep_f8f62968::ActualType, - ) -> pavex::response::Response { - let v2 = app_f8f62968::handler_with_input_tuple(v0, v1); - ::into_response(v2) - } - struct Next0<'a, T> - where - T: std::future::Future, - { - s_0: (bool, char, u8), - s_1: &'a dep_f8f62968::ActualType, - next: fn((bool, char, u8), &'a dep_f8f62968::ActualType) -> 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, self.s_1) - } - } -} -pub mod route_1 { - 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_1::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) - } - } -} From 0d76c710105cd72c463e7397221088cafc206878 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:15:33 +0200 Subject: [PATCH 11/16] Ignore generated files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 28f51945b..105434b4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /libs/ui_tests/target +/libs/ui_tests/**/generated_app/ +/libs/ui_tests/**/blueprint.ron /libs/target /libs/vendor /doc_examples/tutorial_envs/ From e1e9c26207e8ed95d7401f416a6075f44da4a45d Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:15:35 +0200 Subject: [PATCH 12/16] Remove ignored files --- .../app_builder/generated_app/Cargo.toml | 8 - .../app_builder/generated_app/blueprint.ron | 120 ---- .../app_builder/generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 107 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 299 -------- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 96 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 87 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 87 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 236 ------- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 136 ---- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 29 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 149 ---- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 83 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 31 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 63 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 63 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 117 ---- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 43 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 63 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 149 ---- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 57 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 25 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 25 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 128 ---- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 141 ---- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 57 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 108 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 108 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 128 ---- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 47 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 101 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 47 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 47 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 81 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 47 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 81 --- .../generated_app/src/lib.rs | 0 .../invalid_prebuilt/generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 98 --- .../invalid_prebuilt/generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 67 -- .../generated_app/src/lib.rs | 0 .../prebuilt_works/generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 98 --- .../prebuilt_works/generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 67 -- .../generated_app/src/lib.rs | 0 .../unused_prebuilt/generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 26 - .../unused_prebuilt/generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 85 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 59 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 119 ---- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 119 ---- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 312 --------- .../generated_app/src/lib.rs | 0 .../invalid_paths/generated_app/Cargo.toml | 8 - .../invalid_paths/generated_app/blueprint.ron | 122 ---- .../invalid_paths/generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 51 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 30 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 47 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 47 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 47 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 81 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 103 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 83 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 110 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 110 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 110 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 67 -- .../generated_app/src/lib.rs | 0 .../mutability/generated_app/Cargo.toml | 8 - .../mutability/generated_app/blueprint.ron | 70 -- .../mutability/generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 67 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 47 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 30 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 67 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 83 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../generated_app/src/lib.rs | 0 .../transient_cycles/generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../transient_cycles/generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 84 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 30 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 104 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 343 --------- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 112 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 132 ---- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 79 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 99 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 115 --- .../generated_app/src/lib.rs | 0 libs/ui_tests/generated_app/Cargo.toml | 12 - libs/ui_tests/generated_app/src/lib.rs | 166 ----- .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 654 ------------------ .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 107 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 84 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 101 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 105 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 105 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 189 ----- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 30 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 30 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 93 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 30 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 30 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 47 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 30 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 30 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 90 --- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 30 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 63 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 30 - .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 130 ---- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 50 -- .../generated_app/src/lib.rs | 0 .../generated_app/Cargo.toml | 8 - .../generated_app/blueprint.ron | 70 -- .../generated_app/src/lib.rs | 0 424 files changed, 13200 deletions(-) delete mode 100644 libs/ui_tests/app_builder/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/app_builder/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/app_builder/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/common/components_can_fail/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/common/components_can_fail/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/router/fallback_priority/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/router/fallback_priority/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/router/invalid_paths/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/router/invalid_paths/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/router/invalid_paths/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/mutability/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/mutability/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/mutability/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/transitive_borrows/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/transitive_borrows/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/transitive_borrows/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/connection_info/connection_info_happy_path/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/connection_info/connection_info_happy_path/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/error_observers/error_observers_happy_path/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/error_observers/error_observers_happy_path/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/middlewares/middlewares_execution_order/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/middlewares/middlewares_execution_order/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/middlewares/next_handles_mut_references/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/middlewares/next_handles_mut_references/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/common_response_types_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/common_response_types_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/invalid_callable_path/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/invalid_callable_path/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/invalid_callable_path/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/reexported_type_alias_work/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/reexported_type_alias_work/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/static_methods_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/static_methods_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/trait_methods_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/trait_methods_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/tuples_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/tuples_are_supported/generated_app/src/lib.rs delete mode 100644 libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml delete mode 100644 libs/ui_tests/reflection/type_alias_are_supported/generated_app/blueprint.ron delete mode 100644 libs/ui_tests/reflection/type_alias_are_supported/generated_app/src/lib.rs diff --git a/libs/ui_tests/app_builder/generated_app/Cargo.toml b/libs/ui_tests/app_builder/generated_app/Cargo.toml deleted file mode 100644 index 53d61c6b5..000000000 --- a/libs/ui_tests/app_builder/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_f10df8fa" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/app_builder/generated_app/blueprint.ron b/libs/ui_tests/app_builder/generated_app/blueprint.ron deleted file mode 100644 index 704aba976..000000000 --- a/libs/ui_tests/app_builder/generated_app/blueprint.ron +++ /dev/null @@ -1,120 +0,0 @@ -( - creation_location: ( - line: 44, - column: 18, - file: "app_builder/src/lib.rs", - ), - components: [ - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_f10df8fa", - module_path: "app_f10df8fa", - ), - import_path: "crate::Config", - ), - location: ( - line: 45, - column: 8, - file: "app_builder/src/lib.rs", - ), - ), - cloning_strategy: Some(CloneIfNecessary), - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_f10df8fa", - module_path: "app_f10df8fa", - ), - import_path: "crate::http_client", - ), - location: ( - line: 46, - column: 8, - file: "app_builder/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_f10df8fa", - module_path: "app_f10df8fa", - ), - import_path: "crate::extract_path", - ), - location: ( - line: 47, - column: 8, - file: "app_builder/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_f10df8fa", - module_path: "app_f10df8fa", - ), - import_path: "crate::handle_extract_path_error", - ), - location: ( - line: 48, - column: 10, - file: "app_builder/src/lib.rs", - ), - )), - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_f10df8fa", - module_path: "app_f10df8fa", - ), - import_path: "crate::logger", - ), - location: ( - line: 49, - column: 8, - file: "app_builder/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_f10df8fa", - module_path: "app_f10df8fa", - ), - import_path: "crate::stream_file", - ), - location: ( - line: 50, - column: 8, - file: "app_builder/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/app_builder/generated_app/src/lib.rs b/libs/ui_tests/app_builder/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml deleted file mode 100644 index 4194ea107..000000000 --- a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_c62eca9e" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/blueprint.ron deleted file mode 100644 index 9a4c90465..000000000 --- a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,107 +0,0 @@ -( - creation_location: ( - line: 35, - column: 18, - file: "blueprint/common/async_callable_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c62eca9e", - module_path: "app_c62eca9e", - ), - import_path: "crate::http_client", - ), - location: ( - line: 36, - column: 8, - file: "blueprint/common/async_callable_are_supported/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c62eca9e", - module_path: "app_c62eca9e", - ), - import_path: "crate::extract_path", - ), - location: ( - line: 37, - column: 8, - file: "blueprint/common/async_callable_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c62eca9e", - module_path: "app_c62eca9e", - ), - import_path: "crate::logger", - ), - location: ( - line: 38, - column: 8, - file: "blueprint/common/async_callable_are_supported/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_c62eca9e", - module_path: "app_c62eca9e", - ), - import_path: "crate::Config", - ), - location: ( - line: 39, - column: 8, - file: "blueprint/common/async_callable_are_supported/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c62eca9e", - module_path: "app_c62eca9e", - ), - import_path: "crate::stream_file", - ), - location: ( - line: 40, - column: 8, - file: "blueprint/common/async_callable_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/async_callable_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/Cargo.toml deleted file mode 100644 index 459ba445a..000000000 --- a/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_56692d2c" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/blueprint.ron deleted file mode 100644 index 9a1d75aa4..000000000 --- a/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/blueprint.ron +++ /dev/null @@ -1,299 +0,0 @@ -( - creation_location: ( - line: 61, - column: 18, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::constructor", - ), - location: ( - line: 62, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::fallible_unit_constructor", - ), - location: ( - line: 63, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::fallible_constructor", - ), - location: ( - line: 64, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 65, - column: 10, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - )), - lints: {}, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::unit_pre", - ), - location: ( - line: 67, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::fallible_unit_pre", - ), - location: ( - line: 68, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 69, - column: 10, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - )), - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::unit_wrapping", - ), - location: ( - line: 71, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - error_handler: None, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::fallible_unit_wrapping", - ), - location: ( - line: 72, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 73, - column: 10, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - )), - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::unit_post", - ), - location: ( - line: 75, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::fallible_unit_post", - ), - location: ( - line: 76, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 77, - column: 10, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - )), - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::handler", - ), - location: ( - line: 79, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/unit", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::unit_handler", - ), - location: ( - line: 80, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/fallible_unit", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::fallible_unit_handler", - ), - location: ( - line: 81, - column: 8, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_56692d2c", - module_path: "app_56692d2c", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 82, - column: 10, - file: "blueprint/common/cannot_return_the_unit_type/src/lib.rs", - ), - )), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/cannot_return_the_unit_type/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/Cargo.toml deleted file mode 100644 index ce9434d86..000000000 --- a/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_d24e80c4" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/blueprint.ron deleted file mode 100644 index 837fc92ac..000000000 --- a/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/blueprint.ron +++ /dev/null @@ -1,96 +0,0 @@ -( - creation_location: ( - line: 31, - column: 18, - file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d24e80c4", - module_path: "app_d24e80c4", - ), - import_path: "crate::constructor", - ), - location: ( - line: 32, - column: 8, - file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_d24e80c4", - module_path: "app_d24e80c4", - ), - import_path: "crate::wrapping", - ), - location: ( - line: 33, - column: 8, - file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", - ), - ), - error_handler: None, - )), - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_d24e80c4", - module_path: "app_d24e80c4", - ), - import_path: "crate::observer", - ), - location: ( - line: 34, - column: 8, - file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", - ), - ), - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_d24e80c4", - module_path: "app_d24e80c4", - ), - import_path: "crate::handler", - ), - location: ( - line: 35, - column: 8, - file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_d24e80c4", - module_path: "app_d24e80c4", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 36, - column: 10, - file: "blueprint/common/cannot_take_mutable_references_as_input/src/lib.rs", - ), - )), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/cannot_take_mutable_references_as_input/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/Cargo.toml deleted file mode 100644 index 574e58bd5..000000000 --- a/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_46ab7f5d" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/blueprint.ron deleted file mode 100644 index 663b7326f..000000000 --- a/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/blueprint.ron +++ /dev/null @@ -1,87 +0,0 @@ -( - creation_location: ( - line: 22, - column: 18, - file: "blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs", - ), - components: [ - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_46ab7f5d", - module_path: "app_46ab7f5d", - ), - import_path: "crate::C", - ), - location: ( - line: 23, - column: 8, - file: "blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs", - ), - ), - cloning_strategy: Some(CloneIfNecessary), - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_46ab7f5d", - module_path: "app_46ab7f5d", - ), - import_path: "crate::singleton", - ), - location: ( - line: 24, - column: 8, - file: "blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_46ab7f5d", - module_path: "app_46ab7f5d", - ), - import_path: "crate::request_scoped", - ), - location: ( - line: 25, - column: 8, - file: "blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_46ab7f5d", - module_path: "app_46ab7f5d", - ), - import_path: "crate::handler", - ), - location: ( - line: 27, - column: 8, - file: "blueprint/common/cloning_if_necessary_requires_clone/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/cloning_if_necessary_requires_clone/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/Cargo.toml deleted file mode 100644 index ad043daf2..000000000 --- a/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_b02b0728" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/blueprint.ron deleted file mode 100644 index 56791b28a..000000000 --- a/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/blueprint.ron +++ /dev/null @@ -1,87 +0,0 @@ -( - creation_location: ( - line: 27, - column: 18, - file: "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs", - ), - components: [ - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_b02b0728", - module_path: "app_b02b0728", - ), - import_path: "crate::B", - ), - location: ( - line: 28, - column: 8, - file: "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_b02b0728", - module_path: "app_b02b0728", - ), - import_path: "crate::singleton", - ), - location: ( - line: 29, - column: 8, - file: "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_b02b0728", - module_path: "app_b02b0728", - ), - import_path: "crate::singleton2", - ), - location: ( - line: 30, - column: 8, - file: "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_b02b0728", - module_path: "app_b02b0728", - ), - import_path: "crate::handler", - ), - location: ( - line: 31, - column: 8, - file: "blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/cloning_strategy_is_observed_for_singletons_and_state_inputs/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml deleted file mode 100644 index 1ef56ce2f..000000000 --- a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_e501823b" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/blueprint.ron deleted file mode 100644 index 4af433354..000000000 --- a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/blueprint.ron +++ /dev/null @@ -1,236 +0,0 @@ -( - creation_location: ( - line: 102, - column: 18, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - components: [ - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::Config", - ), - location: ( - line: 103, - column: 8, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::http_client", - ), - location: ( - line: 104, - column: 8, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::extract_path", - ), - location: ( - line: 105, - column: 8, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::handle_extract_path_error", - ), - location: ( - line: 106, - column: 10, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - )), - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::logger", - ), - location: ( - line: 107, - column: 8, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::handle_logger_error", - ), - location: ( - line: 108, - column: 10, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - )), - lints: {}, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::fallible_wrapping_middleware", - ), - location: ( - line: 109, - column: 8, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::handle_middleware_error", - ), - location: ( - line: 110, - column: 10, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - )), - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::fallible_pre", - ), - location: ( - line: 111, - column: 8, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::pre_error", - ), - location: ( - line: 112, - column: 10, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - )), - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::fallible_post", - ), - location: ( - line: 113, - column: 8, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::post_error", - ), - location: ( - line: 114, - column: 10, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - )), - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::request_handler", - ), - location: ( - line: 115, - column: 8, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_e501823b", - module_path: "app_e501823b", - ), - import_path: "crate::handle_handler_error", - ), - location: ( - line: 116, - column: 10, - file: "blueprint/common/components_can_fail/src/lib.rs", - ), - )), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/components_can_fail/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/components_can_fail/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/Cargo.toml b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/Cargo.toml deleted file mode 100644 index 30646fe9e..000000000 --- a/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_11354b55" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/blueprint.ron b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/blueprint.ron deleted file mode 100644 index 977c04ccc..000000000 --- a/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/blueprint.ron +++ /dev/null @@ -1,136 +0,0 @@ -( - creation_location: ( - line: 37, - column: 18, - file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", - ), - components: [ - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_11354b55", - module_path: "app_11354b55", - ), - import_path: "crate::wrapping_middleware", - ), - location: ( - line: 38, - column: 8, - file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_11354b55", - module_path: "app_11354b55", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 39, - column: 10, - file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", - ), - )), - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_11354b55", - module_path: "app_11354b55", - ), - import_path: "crate::pp_middleware", - ), - location: ( - line: 40, - column: 8, - file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_11354b55", - module_path: "app_11354b55", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 41, - column: 10, - file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", - ), - )), - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_11354b55", - module_path: "app_11354b55", - ), - import_path: "crate::request_scoped", - ), - location: ( - line: 42, - column: 8, - file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_11354b55", - module_path: "app_11354b55", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 43, - column: 10, - file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_11354b55", - module_path: "app_11354b55", - ), - import_path: "crate::handler", - ), - location: ( - line: 44, - column: 8, - file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_11354b55", - module_path: "app_11354b55", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 45, - column: 10, - file: "blueprint/common/output_type_must_implement_into_response/src/lib.rs", - ), - )), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/src/lib.rs b/libs/ui_tests/blueprint/common/output_type_must_implement_into_response/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml deleted file mode 100644 index 73a04e923..000000000 --- a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_30248169" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/blueprint.ron deleted file mode 100644 index 1f36bc5b5..000000000 --- a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/blueprint.ron +++ /dev/null @@ -1,29 +0,0 @@ -( - creation_location: ( - line: 13, - column: 18, - file: "blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_30248169", - module_path: "app_30248169", - ), - import_path: "crate::Unused::new", - ), - location: ( - line: 14, - column: 8, - file: "blueprint/constructors/a_warning_is_emitted_for_unused_constructors/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/a_warning_is_emitted_for_unused_constructors/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/Cargo.toml deleted file mode 100644 index a08ad51e2..000000000 --- a/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_a442c90a" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/blueprint.ron deleted file mode 100644 index ee9eb86c9..000000000 --- a/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 19, - column: 18, - file: "blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_a442c90a", - module_path: "app_a442c90a", - ), - import_path: "crate::generic_constructor", - ), - location: ( - line: 20, - column: 5, - file: "blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a442c90a", - module_path: "app_a442c90a", - ), - import_path: "crate::handler", - ), - location: ( - line: 21, - column: 8, - file: "blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/constructor_error_spans_are_correct_for_prebuilt_constructors/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/Cargo.toml deleted file mode 100644 index d17d3574c..000000000 --- a/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ebc534c7" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/blueprint.ron deleted file mode 100644 index d9f2f4fd3..000000000 --- a/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 27, - column: 18, - file: "blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ebc534c7", - module_path: "app_ebc534c7", - ), - import_path: "crate::generic_constructor", - ), - location: ( - line: 28, - column: 8, - file: "blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ebc534c7", - module_path: "app_ebc534c7", - ), - import_path: "crate::doubly_generic_constructor", - ), - location: ( - line: 29, - column: 8, - file: "blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ebc534c7", - module_path: "app_ebc534c7", - ), - import_path: "crate::triply_generic_constructor", - ), - location: ( - line: 30, - column: 8, - file: "blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ebc534c7", - module_path: "app_ebc534c7", - ), - import_path: "crate::handler", - ), - location: ( - line: 31, - column: 8, - file: "blueprint/constructors/constructors_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/constructors_input_parameters_cannot_be_generic/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml deleted file mode 100644 index 33a3fa0c3..000000000 --- a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ea979460" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/blueprint.ron deleted file mode 100644 index 584e59a7b..000000000 --- a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/blueprint.ron +++ /dev/null @@ -1,149 +0,0 @@ -( - creation_location: ( - line: 67, - column: 18, - file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ea979460", - module_path: "app_ea979460", - ), - import_path: "crate::json", - ), - location: ( - line: 68, - column: 8, - file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ea979460", - module_path: "app_ea979460", - ), - import_path: "crate::fallible", - ), - location: ( - line: 69, - column: 8, - file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_ea979460", - module_path: "app_ea979460", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 70, - column: 10, - file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", - ), - )), - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ea979460", - module_path: "app_ea979460", - ), - import_path: "crate::fallible_with_generic_error", - ), - location: ( - line: 71, - column: 8, - file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_ea979460", - module_path: "app_ea979460", - ), - import_path: "crate::generic_error_handler", - ), - location: ( - line: 72, - column: 10, - file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", - ), - )), - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ea979460", - module_path: "app_ea979460", - ), - import_path: "crate::fallible_with_generic_error2", - ), - location: ( - line: 73, - column: 8, - file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_ea979460", - module_path: "app_ea979460", - ), - import_path: "crate::doubly_generic_error_handler", - ), - location: ( - line: 74, - column: 10, - file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ea979460", - module_path: "app_ea979460", - ), - import_path: "crate::handler", - ), - location: ( - line: 75, - column: 8, - file: "blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_can_contain_generic_parameters/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/Cargo.toml deleted file mode 100644 index b31ecb60c..000000000 --- a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_6c44cec0" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/blueprint.ron deleted file mode 100644 index 00cd25558..000000000 --- a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/blueprint.ron +++ /dev/null @@ -1,83 +0,0 @@ -( - creation_location: ( - line: 23, - column: 18, - file: "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_6c44cec0", - module_path: "app_6c44cec0", - ), - import_path: "crate::naked", - ), - location: ( - line: 24, - column: 8, - file: "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_6c44cec0", - module_path: "app_6c44cec0", - ), - import_path: "crate::fallible_naked", - ), - location: ( - line: 25, - column: 8, - file: "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_6c44cec0", - module_path: "app_6c44cec0", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 26, - column: 10, - file: "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_6c44cec0", - module_path: "app_6c44cec0", - ), - import_path: "crate::handler", - ), - location: ( - line: 27, - column: 8, - file: "blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/output_type_of_constructors_cannot_be_a_naked_generic/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml deleted file mode 100644 index 44a59cc3c..000000000 --- a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_d0f81bc0" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/blueprint.ron deleted file mode 100644 index b80481b4b..000000000 --- a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 13, - column: 18, - file: "blueprint/constructors/static_references_are_valid_singletons/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d0f81bc0", - module_path: "app_d0f81bc0", - ), - import_path: "crate::static_str", - ), - location: ( - line: 14, - column: 8, - file: "blueprint/constructors/static_references_are_valid_singletons/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/handler", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_d0f81bc0", - module_path: "app_d0f81bc0", - ), - import_path: "crate::handler", - ), - location: ( - line: 15, - column: 8, - file: "blueprint/constructors/static_references_are_valid_singletons/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/static_references_are_valid_singletons/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml deleted file mode 100644 index 58841cafd..000000000 --- a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_55dca802" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/blueprint.ron deleted file mode 100644 index 4c136c468..000000000 --- a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 13, - column: 18, - file: "blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_55dca802", - module_path: "app_55dca802", - ), - import_path: "dep_55dca802::new_logger", - ), - location: ( - line: 14, - column: 8, - file: "blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_55dca802", - module_path: "app_55dca802", - ), - import_path: "::dep_55dca802::new_logger", - ), - location: ( - line: 15, - column: 8, - file: "blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_55dca802", - module_path: "app_55dca802", - ), - import_path: "crate::Streamer::stream_file", - ), - location: ( - line: 16, - column: 8, - file: "blueprint/constructors/the_latest_registered_constructor_takes_precedence/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/the_latest_registered_constructor_takes_precedence/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml deleted file mode 100644 index ac64ee726..000000000 --- a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_621e9d53" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/blueprint.ron deleted file mode 100644 index 44ae12191..000000000 --- a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 19, - column: 18, - file: "blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_621e9d53", - module_path: "app_621e9d53", - ), - import_path: "crate::new_logger", - ), - location: ( - line: 20, - column: 8, - file: "blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_621e9d53", - module_path: "app_621e9d53", - ), - import_path: "crate::new_logger", - ), - location: ( - line: 21, - column: 8, - file: "blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_621e9d53", - module_path: "app_621e9d53", - ), - import_path: "crate::Streamer::stream_file", - ), - location: ( - line: 22, - column: 8, - file: "blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/the_same_constructor_can_be_registered_multiple_times_using_the_same_lifecycle/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/Cargo.toml deleted file mode 100644 index 040b84049..000000000 --- a/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_c5885cdb" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/blueprint.ron deleted file mode 100644 index d8c25f2fa..000000000 --- a/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 39, - column: 18, - file: "blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c5885cdb", - module_path: "app_c5885cdb", - ), - import_path: "crate::NonSendSingleton::new", - ), - location: ( - line: 40, - column: 8, - file: "blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c5885cdb", - module_path: "app_c5885cdb", - ), - import_path: "crate::NonSyncSingleton::new", - ), - location: ( - line: 41, - column: 8, - file: "blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c5885cdb", - module_path: "app_c5885cdb", - ), - import_path: "crate::handler", - ), - location: ( - line: 44, - column: 8, - file: "blueprint/constructors/trait_constraints_on_runtime_singletons/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/trait_constraints_on_runtime_singletons/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml deleted file mode 100644 index 07c476727..000000000 --- a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_46e3d1f1" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/blueprint.ron b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/blueprint.ron deleted file mode 100644 index e6a35b8a6..000000000 --- a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/blueprint.ron +++ /dev/null @@ -1,31 +0,0 @@ -( - creation_location: ( - line: 13, - column: 18, - file: "blueprint/constructors/unused_constructor_warning_can_be_ignored/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_46e3d1f1", - module_path: "app_46e3d1f1", - ), - import_path: "crate::Unused::new", - ), - location: ( - line: 14, - column: 8, - file: "blueprint/constructors/unused_constructor_warning_can_be_ignored/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: { - Unused: Ignore, - }, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/src/lib.rs b/libs/ui_tests/blueprint/constructors/unused_constructor_warning_can_be_ignored/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/Cargo.toml deleted file mode 100644 index b200a70cf..000000000 --- a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_8e8ba674" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/blueprint.ron deleted file mode 100644 index cb080f1a3..000000000 --- a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/blueprint.ron +++ /dev/null @@ -1,63 +0,0 @@ -( - creation_location: ( - line: 22, - column: 18, - file: "blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_8e8ba674", - module_path: "app_8e8ba674", - ), - import_path: "crate::infallible_constructor", - ), - location: ( - line: 23, - column: 8, - file: "blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_8e8ba674", - module_path: "app_8e8ba674", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 24, - column: 10, - file: "blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_8e8ba674", - module_path: "app_8e8ba674", - ), - import_path: "crate::request_handler", - ), - location: ( - line: 25, - column: 8, - file: "blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_a_sync_infallible_constructor/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/Cargo.toml deleted file mode 100644 index cbd0d024e..000000000 --- a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_c3c254cf" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/blueprint.ron deleted file mode 100644 index 69fdd23f7..000000000 --- a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/blueprint.ron +++ /dev/null @@ -1,63 +0,0 @@ -( - creation_location: ( - line: 22, - column: 18, - file: "blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c3c254cf", - module_path: "app_c3c254cf", - ), - import_path: "crate::infallible_constructor", - ), - location: ( - line: 23, - column: 8, - file: "blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_c3c254cf", - module_path: "app_c3c254cf", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 24, - column: 10, - file: "blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c3c254cf", - module_path: "app_c3c254cf", - ), - import_path: "crate::request_handler", - ), - location: ( - line: 25, - column: 8, - file: "blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/cannot_register_an_error_handler_for_an_async_infallible_constructor/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml deleted file mode 100644 index 7062f8b31..000000000 --- a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_40a0f751" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/blueprint.ron deleted file mode 100644 index fbed8010b..000000000 --- a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/blueprint.ron +++ /dev/null @@ -1,117 +0,0 @@ -( - creation_location: ( - line: 33, - column: 18, - file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_40a0f751", - module_path: "app_40a0f751", - ), - import_path: "crate::fallible_constructor", - ), - location: ( - line: 34, - column: 8, - file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_40a0f751", - module_path: "app_40a0f751", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 35, - column: 10, - file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/without_observer", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_40a0f751", - module_path: "app_40a0f751", - ), - import_path: "crate::handler", - ), - location: ( - line: 38, - column: 8, - file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", - ), - ), - error_handler: None, - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 41, - column: 22, - file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", - ), - components: [ - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_40a0f751", - module_path: "app_40a0f751", - ), - import_path: "crate::error_observer", - ), - location: ( - line: 42, - column: 12, - file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", - ), - ), - )), - Route(( - path: "/with_observer", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_40a0f751", - module_path: "app_40a0f751", - ), - import_path: "crate::handler", - ), - location: ( - line: 43, - column: 12, - file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 40, - column: 8, - file: "blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/src/lib.rs", - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_can_take_pavex_error_rather_than_specific_error_type/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/Cargo.toml deleted file mode 100644 index a6a20684c..000000000 --- a/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_6e40e01f" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/blueprint.ron deleted file mode 100644 index 5e9fd6361..000000000 --- a/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/blueprint.ron +++ /dev/null @@ -1,43 +0,0 @@ -( - creation_location: ( - line: 14, - column: 18, - file: "blueprint/error_handlers/error_handlers_cannot_be_fallible/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_6e40e01f", - module_path: "app_6e40e01f", - ), - import_path: "crate::handler", - ), - location: ( - line: 15, - column: 8, - file: "blueprint/error_handlers/error_handlers_cannot_be_fallible/src/lib.rs", - ), - ), - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_6e40e01f", - module_path: "app_6e40e01f", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 16, - column: 10, - file: "blueprint/error_handlers/error_handlers_cannot_be_fallible/src/lib.rs", - ), - )), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_cannot_be_fallible/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/Cargo.toml deleted file mode 100644 index 8bdd5042d..000000000 --- a/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_3fac62e4" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/blueprint.ron deleted file mode 100644 index f2cb0fe58..000000000 --- a/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/blueprint.ron +++ /dev/null @@ -1,63 +0,0 @@ -( - creation_location: ( - line: 21, - column: 18, - file: "blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_3fac62e4", - module_path: "app_3fac62e4", - ), - import_path: "crate::fallible_constructor", - ), - location: ( - line: 22, - column: 8, - file: "blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_3fac62e4", - module_path: "app_3fac62e4", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 23, - column: 10, - file: "blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_3fac62e4", - module_path: "app_3fac62e4", - ), - import_path: "crate::handler", - ), - location: ( - line: 24, - column: 8, - file: "blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/error_handlers_must_take_a_reference_to_the_error_as_input/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/Cargo.toml deleted file mode 100644 index af0200f4e..000000000 --- a/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_51ea2925" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/blueprint.ron deleted file mode 100644 index 28adffb61..000000000 --- a/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/blueprint.ron +++ /dev/null @@ -1,149 +0,0 @@ -( - creation_location: ( - line: 51, - column: 18, - file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_51ea2925", - module_path: "app_51ea2925", - ), - import_path: "crate::generic_constructor", - ), - location: ( - line: 52, - column: 8, - file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_51ea2925", - module_path: "app_51ea2925", - ), - import_path: "crate::constructor1", - ), - location: ( - line: 53, - column: 8, - file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_51ea2925", - module_path: "app_51ea2925", - ), - import_path: "crate::generic_error_handler", - ), - location: ( - line: 54, - column: 10, - file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", - ), - )), - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_51ea2925", - module_path: "app_51ea2925", - ), - import_path: "crate::constructor2", - ), - location: ( - line: 55, - column: 8, - file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_51ea2925", - module_path: "app_51ea2925", - ), - import_path: "crate::doubly_generic_error_handler", - ), - location: ( - line: 56, - column: 10, - file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", - ), - )), - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_51ea2925", - module_path: "app_51ea2925", - ), - import_path: "crate::constructor3", - ), - location: ( - line: 57, - column: 8, - file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_51ea2925", - module_path: "app_51ea2925", - ), - import_path: "crate::triply_generic_error_handler", - ), - location: ( - line: 58, - column: 10, - file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_51ea2925", - module_path: "app_51ea2925", - ), - import_path: "crate::handler", - ), - location: ( - line: 59, - column: 8, - file: "blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_handlers/generics_in_error_handlers_must_be_tied_to_the_error/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/Cargo.toml deleted file mode 100644 index 83913450b..000000000 --- a/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_a0da5eb4" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/blueprint.ron deleted file mode 100644 index 87352c6db..000000000 --- a/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/blueprint.ron +++ /dev/null @@ -1,57 +0,0 @@ -( - creation_location: ( - line: 20, - column: 18, - file: "blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs", - ), - components: [ - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_a0da5eb4", - module_path: "app_a0da5eb4", - ), - import_path: "crate::generic", - ), - location: ( - line: 21, - column: 8, - file: "blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - )), - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_a0da5eb4", - module_path: "app_a0da5eb4", - ), - import_path: "crate::generic2", - ), - location: ( - line: 22, - column: 8, - file: "blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - )), - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_a0da5eb4", - module_path: "app_a0da5eb4", - ), - import_path: "crate::generic3", - ), - location: ( - line: 23, - column: 8, - file: "blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_observers/error_observers_input_parameters_cannot_be_generic/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/Cargo.toml deleted file mode 100644 index 9b3e929ad..000000000 --- a/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_e31b3bf3" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/blueprint.ron deleted file mode 100644 index 3f78ee162..000000000 --- a/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/blueprint.ron +++ /dev/null @@ -1,25 +0,0 @@ -( - creation_location: ( - line: 9, - column: 18, - file: "blueprint/error_observers/error_observers_must_return_the_unit_type/src/lib.rs", - ), - components: [ - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_e31b3bf3", - module_path: "app_e31b3bf3", - ), - import_path: "crate::error_observer", - ), - location: ( - line: 10, - column: 8, - file: "blueprint/error_observers/error_observers_must_return_the_unit_type/src/lib.rs", - ), - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_observers/error_observers_must_return_the_unit_type/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/Cargo.toml b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/Cargo.toml deleted file mode 100644 index 7dd9e6402..000000000 --- a/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_8b77b4be" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/blueprint.ron b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/blueprint.ron deleted file mode 100644 index d1decaf43..000000000 --- a/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/blueprint.ron +++ /dev/null @@ -1,25 +0,0 @@ -( - creation_location: ( - line: 9, - column: 18, - file: "blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src/lib.rs", - ), - components: [ - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_8b77b4be", - module_path: "app_8b77b4be", - ), - import_path: "crate::error_observer", - ), - location: ( - line: 10, - column: 8, - file: "blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/src/lib.rs", - ), - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/src/lib.rs b/libs/ui_tests/blueprint/error_observers/error_observers_must_take_pavex_error_as_ref/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml deleted file mode 100644 index 7a23fd18b..000000000 --- a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ea86e18a" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/blueprint.ron deleted file mode 100644 index f3035731e..000000000 --- a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/blueprint.ron +++ /dev/null @@ -1,128 +0,0 @@ -( - creation_location: ( - line: 8, - column: 18, - file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ea86e18a", - module_path: "app_ea86e18a", - ), - import_path: "crate::parent_singleton", - ), - location: ( - line: 9, - column: 8, - file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/parent", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ea86e18a", - module_path: "app_ea86e18a", - ), - import_path: "crate::parent_handler", - ), - location: ( - line: 10, - column: 8, - file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", - ), - ), - error_handler: None, - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 24, - column: 18, - file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ea86e18a", - module_path: "app_ea86e18a", - ), - import_path: "crate::singleton_dep", - ), - location: ( - line: 25, - column: 8, - file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ea86e18a", - module_path: "app_ea86e18a", - ), - import_path: "crate::nested_singleton", - ), - location: ( - line: 26, - column: 8, - file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/child", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ea86e18a", - module_path: "app_ea86e18a", - ), - import_path: "crate::nested_handler", - ), - location: ( - line: 27, - column: 8, - file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 11, - column: 8, - file: "blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/src/lib.rs", - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/application_state_should_include_runtime_singletons_from_all_scopes/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml deleted file mode 100644 index 1cd90c198..000000000 --- a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_91e1ac20" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/blueprint.ron deleted file mode 100644 index d276acf1f..000000000 --- a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,141 +0,0 @@ -( - creation_location: ( - line: 8, - column: 18, - file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_91e1ac20", - module_path: "app_91e1ac20", - ), - import_path: "crate::first", - ), - location: ( - line: 9, - column: 8, - file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 15, - column: 18, - file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_91e1ac20", - module_path: "app_91e1ac20", - ), - import_path: "crate::second", - ), - location: ( - line: 16, - column: 8, - file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 22, - column: 18, - file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_91e1ac20", - module_path: "app_91e1ac20", - ), - import_path: "crate::third", - ), - location: ( - line: 23, - column: 8, - file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 29, - column: 18, - file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_91e1ac20", - module_path: "app_91e1ac20", - ), - import_path: "crate::handler", - ), - location: ( - line: 30, - column: 8, - file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: Some("/third"), - nesting_location: ( - line: 24, - column: 8, - file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", - ), - )), - ], - ), - path_prefix: Some("/second"), - nesting_location: ( - line: 17, - column: 8, - file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", - ), - )), - ], - ), - path_prefix: Some("/first"), - nesting_location: ( - line: 10, - column: 8, - file: "blueprint/nesting/multiple_levels_of_nesting_are_supported/src/lib.rs", - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/multiple_levels_of_nesting_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/Cargo.toml deleted file mode 100644 index fbbc328dc..000000000 --- a/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_5f6d02ba" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/blueprint.ron deleted file mode 100644 index 95c2ee82f..000000000 --- a/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/blueprint.ron +++ /dev/null @@ -1,57 +0,0 @@ -( - creation_location: ( - line: 7, - column: 18, - file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", - ), - components: [ - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 19, - column: 5, - file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", - ), - components: [], - ), - path_prefix: Some(""), - nesting_location: ( - line: 9, - column: 8, - file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", - ), - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 19, - column: 5, - file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", - ), - components: [], - ), - path_prefix: Some("api"), - nesting_location: ( - line: 11, - column: 8, - file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", - ), - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 19, - column: 5, - file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", - ), - components: [], - ), - path_prefix: Some("/api/"), - nesting_location: ( - line: 13, - column: 8, - file: "blueprint/nesting/nest_at_prefix_is_validated/src/lib.rs", - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/nest_at_prefix_is_validated/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/Cargo.toml deleted file mode 100644 index 02dbfa0ec..000000000 --- a/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_309371bf" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/blueprint.ron deleted file mode 100644 index f90eeff0d..000000000 --- a/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/blueprint.ron +++ /dev/null @@ -1,108 +0,0 @@ -( - creation_location: ( - line: 8, - column: 18, - file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_309371bf", - module_path: "app_309371bf", - ), - import_path: "crate::singleton", - ), - location: ( - line: 9, - column: 8, - file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/parent", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_309371bf", - module_path: "app_309371bf", - ), - import_path: "crate::handler", - ), - location: ( - line: 10, - column: 8, - file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", - ), - ), - error_handler: None, - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 28, - column: 18, - file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_309371bf", - module_path: "app_309371bf", - ), - import_path: "crate::overridden_singleton", - ), - location: ( - line: 29, - column: 8, - file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/child", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_309371bf", - module_path: "app_309371bf", - ), - import_path: "crate::handler", - ), - location: ( - line: 30, - column: 8, - file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 11, - column: 8, - file: "blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/src/lib.rs", - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/nesting_fails_if_parent_singleton_is_overridden/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/Cargo.toml deleted file mode 100644 index d78552202..000000000 --- a/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_de592621" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/blueprint.ron deleted file mode 100644 index ad1e438f2..000000000 --- a/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/blueprint.ron +++ /dev/null @@ -1,108 +0,0 @@ -( - creation_location: ( - line: 8, - column: 18, - file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_de592621", - module_path: "app_de592621", - ), - import_path: "crate::singleton", - ), - location: ( - line: 9, - column: 8, - file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/parent", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_de592621", - module_path: "app_de592621", - ), - import_path: "crate::handler", - ), - location: ( - line: 10, - column: 8, - file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", - ), - ), - error_handler: None, - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 24, - column: 18, - file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_de592621", - module_path: "app_de592621", - ), - import_path: "crate::singleton", - ), - location: ( - line: 25, - column: 8, - file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/child", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_de592621", - module_path: "app_de592621", - ), - import_path: "crate::handler", - ), - location: ( - line: 26, - column: 8, - file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 11, - column: 8, - file: "blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/src/lib.rs", - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/nesting_fails_if_the_same_singleton_constructor_is_registered_in_different_scopes/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/Cargo.toml b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/Cargo.toml deleted file mode 100644 index 1a4ecfc04..000000000 --- a/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ae32f1c9" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/blueprint.ron b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/blueprint.ron deleted file mode 100644 index b0ada944d..000000000 --- a/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/blueprint.ron +++ /dev/null @@ -1,128 +0,0 @@ -( - creation_location: ( - line: 8, - column: 18, - file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", - ), - components: [ - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 31, - column: 18, - file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ae32f1c9", - module_path: "app_ae32f1c9", - ), - import_path: "crate::singleton", - ), - location: ( - line: 32, - column: 8, - file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ae32f1c9", - module_path: "app_ae32f1c9", - ), - import_path: "crate::scoped", - ), - location: ( - line: 33, - column: 8, - file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ae32f1c9", - module_path: "app_ae32f1c9", - ), - import_path: "crate::transient", - ), - location: ( - line: 34, - column: 8, - file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/child", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ae32f1c9", - module_path: "app_ae32f1c9", - ), - import_path: "crate::handler", - ), - location: ( - line: 35, - column: 8, - file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 9, - column: 8, - file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", - ), - )), - Route(( - path: "/parent", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ae32f1c9", - module_path: "app_ae32f1c9", - ), - import_path: "crate::handler", - ), - location: ( - line: 10, - column: 8, - file: "blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/src/lib.rs b/libs/ui_tests/blueprint/nesting/nesting_hides_constructors_of_the_nested_bp_to_the_parent_bp/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/Cargo.toml deleted file mode 100644 index 606770356..000000000 --- a/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_466ed127" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/blueprint.ron b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/blueprint.ron deleted file mode 100644 index 1f20fdc01..000000000 --- a/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/blueprint.ron +++ /dev/null @@ -1,47 +0,0 @@ -( - creation_location: ( - line: 14, - column: 18, - file: "blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/lib.rs", - ), - components: [ - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_466ed127", - module_path: "app_466ed127", - ), - import_path: "crate::mw", - ), - location: ( - line: 15, - column: 8, - file: "blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_466ed127", - module_path: "app_466ed127", - ), - import_path: "crate::handler", - ), - location: ( - line: 16, - column: 8, - file: "blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/cannot_have_multiple_response_inputs/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml deleted file mode 100644 index fa5c60865..000000000 --- a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_41064ffa" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/blueprint.ron b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/blueprint.ron deleted file mode 100644 index 5a4789225..000000000 --- a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/blueprint.ron +++ /dev/null @@ -1,101 +0,0 @@ -( - creation_location: ( - line: 28, - column: 18, - file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_41064ffa", - module_path: "app_41064ffa", - ), - import_path: "crate::a", - ), - location: ( - line: 29, - column: 8, - file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_41064ffa", - module_path: "app_41064ffa", - ), - import_path: "crate::first", - ), - location: ( - line: 30, - column: 8, - file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_41064ffa", - module_path: "app_41064ffa", - ), - import_path: "crate::second", - ), - location: ( - line: 31, - column: 8, - file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_41064ffa", - module_path: "app_41064ffa", - ), - import_path: "crate::third", - ), - location: ( - line: 32, - column: 8, - file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_41064ffa", - module_path: "app_41064ffa", - ), - import_path: "crate::handler", - ), - location: ( - line: 33, - column: 8, - file: "blueprint/post_processing_middlewares/finalizer_pattern/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/finalizer_pattern/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/Cargo.toml deleted file mode 100644 index bd8b965f2..000000000 --- a/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_4a62f10c" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/blueprint.ron b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/blueprint.ron deleted file mode 100644 index 9efc5370e..000000000 --- a/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/blueprint.ron +++ /dev/null @@ -1,47 +0,0 @@ -( - creation_location: ( - line: 14, - column: 18, - file: "blueprint/post_processing_middlewares/must_take_response_as_input/src/lib.rs", - ), - components: [ - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_4a62f10c", - module_path: "app_4a62f10c", - ), - import_path: "crate::mw", - ), - location: ( - line: 15, - column: 8, - file: "blueprint/post_processing_middlewares/must_take_response_as_input/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_4a62f10c", - module_path: "app_4a62f10c", - ), - import_path: "crate::handler", - ), - location: ( - line: 16, - column: 8, - file: "blueprint/post_processing_middlewares/must_take_response_as_input/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/must_take_response_as_input/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml deleted file mode 100644 index af1396c50..000000000 --- a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_c8000fe9" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/blueprint.ron b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/blueprint.ron deleted file mode 100644 index 8e148347a..000000000 --- a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/blueprint.ron +++ /dev/null @@ -1,47 +0,0 @@ -( - creation_location: ( - line: 14, - column: 18, - file: "blueprint/post_processing_middlewares/post_process_without_wrapping/src/lib.rs", - ), - components: [ - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_c8000fe9", - module_path: "app_c8000fe9", - ), - import_path: "crate::mw", - ), - location: ( - line: 15, - column: 8, - file: "blueprint/post_processing_middlewares/post_process_without_wrapping/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c8000fe9", - module_path: "app_c8000fe9", - ), - import_path: "crate::handler", - ), - location: ( - line: 16, - column: 8, - file: "blueprint/post_processing_middlewares/post_process_without_wrapping/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/post_process_without_wrapping/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml deleted file mode 100644 index 32d31a1f6..000000000 --- a/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_59d05850" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron deleted file mode 100644 index 0660c3924..000000000 --- a/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron +++ /dev/null @@ -1,81 +0,0 @@ -( - creation_location: ( - line: 34, - column: 18, - file: "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - components: [ - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_59d05850", - module_path: "app_59d05850", - ), - import_path: "crate::generic", - ), - location: ( - line: 35, - column: 8, - file: "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_59d05850", - module_path: "app_59d05850", - ), - import_path: "crate::doubly_generic", - ), - location: ( - line: 36, - column: 8, - file: "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_59d05850", - module_path: "app_59d05850", - ), - import_path: "crate::triply_generic", - ), - location: ( - line: 37, - column: 8, - file: "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_59d05850", - module_path: "app_59d05850", - ), - import_path: "crate::handler", - ), - location: ( - line: 38, - column: 8, - file: "blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/post_processing_middlewares/post_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml deleted file mode 100644 index 9a8735420..000000000 --- a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_8ac65a81" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/blueprint.ron b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/blueprint.ron deleted file mode 100644 index e59a78af3..000000000 --- a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/blueprint.ron +++ /dev/null @@ -1,47 +0,0 @@ -( - creation_location: ( - line: 15, - column: 18, - file: "blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/lib.rs", - ), - components: [ - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_8ac65a81", - module_path: "app_8ac65a81", - ), - import_path: "crate::pre", - ), - location: ( - line: 16, - column: 8, - file: "blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_8ac65a81", - module_path: "app_8ac65a81", - ), - import_path: "crate::handler", - ), - location: ( - line: 17, - column: 8, - file: "blueprint/pre_processing_middlewares/pre_process_without_wrapping/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/src/lib.rs b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_process_without_wrapping/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml deleted file mode 100644 index ef038b5f1..000000000 --- a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_b3516518" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron deleted file mode 100644 index ab3520072..000000000 --- a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron +++ /dev/null @@ -1,81 +0,0 @@ -( - creation_location: ( - line: 29, - column: 18, - file: "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - components: [ - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_b3516518", - module_path: "app_b3516518", - ), - import_path: "crate::generic", - ), - location: ( - line: 30, - column: 8, - file: "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_b3516518", - module_path: "app_b3516518", - ), - import_path: "crate::doubly_generic", - ), - location: ( - line: 31, - column: 8, - file: "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_b3516518", - module_path: "app_b3516518", - ), - import_path: "crate::triply_generic", - ), - location: ( - line: 32, - column: 8, - file: "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_b3516518", - module_path: "app_b3516518", - ), - import_path: "crate::handler", - ), - location: ( - line: 33, - column: 8, - file: "blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/pre_processing_middlewares/pre_processing_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/Cargo.toml deleted file mode 100644 index 35b424cf8..000000000 --- a/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_9d0a5748" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/blueprint.ron b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/blueprint.ron deleted file mode 100644 index 9ac94854a..000000000 --- a/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/blueprint.ron +++ /dev/null @@ -1,98 +0,0 @@ -( - creation_location: ( - line: 28, - column: 18, - file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", - ), - components: [ - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_9d0a5748", - module_path: "app_9d0a5748", - ), - import_path: "crate::A", - ), - location: ( - line: 29, - column: 8, - file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_9d0a5748", - module_path: "app_9d0a5748", - ), - import_path: "crate::B", - ), - location: ( - line: 30, - column: 8, - file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_9d0a5748", - module_path: "app_9d0a5748", - ), - import_path: "crate::C", - ), - location: ( - line: 31, - column: 8, - file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_9d0a5748", - module_path: "app_9d0a5748", - ), - import_path: "crate::D", - ), - location: ( - line: 32, - column: 8, - file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_9d0a5748", - module_path: "app_9d0a5748", - ), - import_path: "crate::handler", - ), - location: ( - line: 33, - column: 8, - file: "blueprint/prebuilts/invalid_prebuilt/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/invalid_prebuilt/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml deleted file mode 100644 index ddbd18f7f..000000000 --- a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_776ff188" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/blueprint.ron b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/blueprint.ron deleted file mode 100644 index 900ce486a..000000000 --- a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/blueprint.ron +++ /dev/null @@ -1,67 +0,0 @@ -( - creation_location: ( - line: 20, - column: 18, - file: "blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/lib.rs", - ), - components: [ - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_776ff188", - module_path: "app_776ff188", - ), - import_path: "crate::A", - ), - location: ( - line: 21, - column: 8, - file: "blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_776ff188", - module_path: "app_776ff188", - ), - import_path: "crate::b", - ), - location: ( - line: 22, - column: 8, - file: "blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_776ff188", - module_path: "app_776ff188", - ), - import_path: "crate::handler", - ), - location: ( - line: 23, - column: 8, - file: "blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_does_not_need_to_be_send_and_sync_if_only_used_at_build_time/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml deleted file mode 100644 index 0b7bcc33d..000000000 --- a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_e4a8214b" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/blueprint.ron b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/blueprint.ron deleted file mode 100644 index 5121a58f1..000000000 --- a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/blueprint.ron +++ /dev/null @@ -1,98 +0,0 @@ -( - creation_location: ( - line: 19, - column: 18, - file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", - ), - components: [ - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_e4a8214b", - module_path: "app_e4a8214b", - ), - import_path: "crate::A", - ), - location: ( - line: 20, - column: 8, - file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_e4a8214b", - module_path: "app_e4a8214b", - ), - import_path: "crate::B", - ), - location: ( - line: 21, - column: 8, - file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_e4a8214b", - module_path: "app_e4a8214b", - ), - import_path: "crate::C<\'static>", - ), - location: ( - line: 22, - column: 8, - file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", - ), - ), - cloning_strategy: Some(CloneIfNecessary), - )), - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_e4a8214b", - module_path: "app_e4a8214b", - ), - import_path: "std::vec::Vec", - ), - location: ( - line: 23, - column: 8, - file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", - ), - ), - cloning_strategy: Some(CloneIfNecessary), - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_e4a8214b", - module_path: "app_e4a8214b", - ), - import_path: "crate::handler", - ), - location: ( - line: 25, - column: 8, - file: "blueprint/prebuilts/prebuilt_works/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilt_works/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml deleted file mode 100644 index 2268cbac8..000000000 --- a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_4c9069e8" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/blueprint.ron b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/blueprint.ron deleted file mode 100644 index 028193b9f..000000000 --- a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/blueprint.ron +++ /dev/null @@ -1,67 +0,0 @@ -( - creation_location: ( - line: 20, - column: 18, - file: "blueprint/prebuilts/prebuilts_can_be_cloned/src/lib.rs", - ), - components: [ - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_4c9069e8", - module_path: "app_4c9069e8", - ), - import_path: "crate::A", - ), - location: ( - line: 21, - column: 8, - file: "blueprint/prebuilts/prebuilts_can_be_cloned/src/lib.rs", - ), - ), - cloning_strategy: Some(CloneIfNecessary), - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_4c9069e8", - module_path: "app_4c9069e8", - ), - import_path: "crate::b", - ), - location: ( - line: 22, - column: 8, - file: "blueprint/prebuilts/prebuilts_can_be_cloned/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_4c9069e8", - module_path: "app_4c9069e8", - ), - import_path: "crate::handler", - ), - location: ( - line: 23, - column: 8, - file: "blueprint/prebuilts/prebuilts_can_be_cloned/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/prebuilts_can_be_cloned/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml deleted file mode 100644 index 7c25a7523..000000000 --- a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ee506b88" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/blueprint.ron b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/blueprint.ron deleted file mode 100644 index f85a5ef0e..000000000 --- a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/blueprint.ron +++ /dev/null @@ -1,26 +0,0 @@ -( - creation_location: ( - line: 7, - column: 18, - file: "blueprint/prebuilts/unused_prebuilt/src/lib.rs", - ), - components: [ - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_ee506b88", - module_path: "app_ee506b88", - ), - import_path: "crate::Unused", - ), - location: ( - line: 8, - column: 8, - file: "blueprint/prebuilts/unused_prebuilt/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/src/lib.rs b/libs/ui_tests/blueprint/prebuilts/unused_prebuilt/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/Cargo.toml deleted file mode 100644 index be4b5b16b..000000000 --- a/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_9fbe7a0c" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/blueprint.ron deleted file mode 100644 index 5f3e8c9fa..000000000 --- a/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/blueprint.ron +++ /dev/null @@ -1,85 +0,0 @@ -( - creation_location: ( - line: 20, - column: 18, - file: "blueprint/router/ambiguous_fallback/src/lib.rs", - ), - components: [ - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 22, - column: 22, - file: "blueprint/router/ambiguous_fallback/src/lib.rs", - ), - components: [ - Route(( - path: "/id", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_9fbe7a0c", - module_path: "app_9fbe7a0c", - ), - import_path: "crate::handler", - ), - location: ( - line: 23, - column: 12, - file: "blueprint/router/ambiguous_fallback/src/lib.rs", - ), - ), - error_handler: None, - )), - FallbackRequestHandler(( - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_9fbe7a0c", - module_path: "app_9fbe7a0c", - ), - import_path: "crate::fallback1", - ), - location: ( - line: 24, - column: 12, - file: "blueprint/router/ambiguous_fallback/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: Some("/users"), - nesting_location: ( - line: 21, - column: 8, - file: "blueprint/router/ambiguous_fallback/src/lib.rs", - ), - )), - Route(( - path: "/users/yo", - method_guard: Some([ - "POST", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_9fbe7a0c", - module_path: "app_9fbe7a0c", - ), - import_path: "crate::handler", - ), - location: ( - line: 27, - column: 8, - file: "blueprint/router/ambiguous_fallback/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/ambiguous_fallback/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/Cargo.toml deleted file mode 100644 index 7ee8db0a8..000000000 --- a/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_6b4ffaf2" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/blueprint.ron deleted file mode 100644 index 475f0984c..000000000 --- a/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/blueprint.ron +++ /dev/null @@ -1,59 +0,0 @@ -( - creation_location: ( - line: 16, - column: 18, - file: "blueprint/router/conflicting_any_and_single_method_guards/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "CONNECT", - "DELETE", - "GET", - "HEAD", - "OPTIONS", - "PATCH", - "POST", - "PUT", - "TRACE", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_6b4ffaf2", - module_path: "app_6b4ffaf2", - ), - import_path: "crate::handler_1", - ), - location: ( - line: 17, - column: 8, - file: "blueprint/router/conflicting_any_and_single_method_guards/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_6b4ffaf2", - module_path: "app_6b4ffaf2", - ), - import_path: "crate::handler_2", - ), - location: ( - line: 18, - column: 8, - file: "blueprint/router/conflicting_any_and_single_method_guards/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/conflicting_any_and_single_method_guards/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/Cargo.toml deleted file mode 100644 index 4d7a26379..000000000 --- a/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_951b7f8d" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/blueprint.ron deleted file mode 100644 index d28964af9..000000000 --- a/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/blueprint.ron +++ /dev/null @@ -1,119 +0,0 @@ -( - creation_location: ( - line: 20, - column: 18, - file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", - ), - components: [ - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 22, - column: 22, - file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", - ), - components: [ - Route(( - path: "/id", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_951b7f8d", - module_path: "app_951b7f8d", - ), - import_path: "crate::handler", - ), - location: ( - line: 23, - column: 12, - file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", - ), - ), - error_handler: None, - )), - FallbackRequestHandler(( - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_951b7f8d", - module_path: "app_951b7f8d", - ), - import_path: "crate::fallback1", - ), - location: ( - line: 24, - column: 12, - file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 21, - column: 8, - file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", - ), - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 28, - column: 22, - file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", - ), - components: [ - Route(( - path: "/id", - method_guard: Some([ - "POST", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_951b7f8d", - module_path: "app_951b7f8d", - ), - import_path: "crate::handler", - ), - location: ( - line: 29, - column: 12, - file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", - ), - ), - error_handler: None, - )), - FallbackRequestHandler(( - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_951b7f8d", - module_path: "app_951b7f8d", - ), - import_path: "crate::fallback2", - ), - location: ( - line: 30, - column: 12, - file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 27, - column: 8, - file: "blueprint/router/different_fallback_for_each_method/src/lib.rs", - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/different_fallback_for_each_method/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml deleted file mode 100644 index 58a06b2a9..000000000 --- a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_78452ff2" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/blueprint.ron deleted file mode 100644 index f60be2d68..000000000 --- a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/blueprint.ron +++ /dev/null @@ -1,119 +0,0 @@ -( - creation_location: ( - line: 21, - column: 18, - file: "blueprint/router/fallback_priority/src/lib.rs", - ), - components: [ - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 23, - column: 22, - file: "blueprint/router/fallback_priority/src/lib.rs", - ), - components: [ - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_78452ff2", - module_path: "app_78452ff2", - ), - import_path: "crate::handler", - ), - location: ( - line: 24, - column: 12, - file: "blueprint/router/fallback_priority/src/lib.rs", - ), - ), - error_handler: None, - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 26, - column: 26, - file: "blueprint/router/fallback_priority/src/lib.rs", - ), - components: [ - Route(( - path: "/id", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_78452ff2", - module_path: "app_78452ff2", - ), - import_path: "crate::handler", - ), - location: ( - line: 27, - column: 16, - file: "blueprint/router/fallback_priority/src/lib.rs", - ), - ), - error_handler: None, - )), - FallbackRequestHandler(( - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_78452ff2", - module_path: "app_78452ff2", - ), - import_path: "crate::forbidden", - ), - location: ( - line: 28, - column: 16, - file: "blueprint/router/fallback_priority/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 25, - column: 12, - file: "blueprint/router/fallback_priority/src/lib.rs", - ), - )), - FallbackRequestHandler(( - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_78452ff2", - module_path: "app_78452ff2", - ), - import_path: "crate::unauthorized", - ), - location: ( - line: 31, - column: 12, - file: "blueprint/router/fallback_priority/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: Some("/users"), - nesting_location: ( - line: 22, - column: 8, - file: "blueprint/router/fallback_priority/src/lib.rs", - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/fallback_priority/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/fallback_priority/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml deleted file mode 100644 index d09d063f8..000000000 --- a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_a6a2e116" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/blueprint.ron deleted file mode 100644 index 10f7368b8..000000000 --- a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/blueprint.ron +++ /dev/null @@ -1,312 +0,0 @@ -( - creation_location: ( - line: 18, - column: 18, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - components: [ - Route(( - path: "/connect", - method_guard: Some([ - "CONNECT", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 19, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/delete", - method_guard: Some([ - "DELETE", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 20, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/get", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 21, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/head", - method_guard: Some([ - "HEAD", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 22, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/options", - method_guard: Some([ - "OPTIONS", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 23, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/patch", - method_guard: Some([ - "PATCH", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 24, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/post", - method_guard: Some([ - "POST", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 25, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/put", - method_guard: Some([ - "PUT", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 26, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/trace", - method_guard: Some([ - "TRACE", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 27, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/any", - method_guard: Some([ - "CONNECT", - "DELETE", - "GET", - "HEAD", - "OPTIONS", - "PATCH", - "POST", - "PUT", - "TRACE", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 28, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/any_w_extensions", - method_guard: Any, - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 29, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/mixed", - method_guard: Some([ - "PATCH", - "POST", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 30, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/custom", - method_guard: Some([ - "CUSTOM", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 34, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/mixed_with_custom", - method_guard: Some([ - "CUSTOM", - "GET", - "HEY", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a6a2e116", - module_path: "app_a6a2e116", - ), - import_path: "crate::handler", - ), - location: ( - line: 35, - column: 8, - file: "blueprint/router/http_method_routing_variants/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/http_method_routing_variants/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/router/invalid_paths/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/invalid_paths/generated_app/Cargo.toml deleted file mode 100644 index 2df526567..000000000 --- a/libs/ui_tests/blueprint/router/invalid_paths/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_fc852cc3" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/invalid_paths/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/invalid_paths/generated_app/blueprint.ron deleted file mode 100644 index 42bf40645..000000000 --- a/libs/ui_tests/blueprint/router/invalid_paths/generated_app/blueprint.ron +++ /dev/null @@ -1,122 +0,0 @@ -( - creation_location: ( - line: 12, - column: 18, - file: "blueprint/router/invalid_paths/src/lib.rs", - ), - components: [ - Route(( - path: "/:too:many:params", - method_guard: Some([ - "CONNECT", - "DELETE", - "GET", - "HEAD", - "OPTIONS", - "PATCH", - "POST", - "PUT", - "TRACE", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_fc852cc3", - module_path: "app_fc852cc3", - ), - import_path: "crate::handler", - ), - location: ( - line: 13, - column: 8, - file: "blueprint/router/invalid_paths/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/*invalid_catch_all/hey", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_fc852cc3", - module_path: "app_fc852cc3", - ), - import_path: "crate::handler", - ), - location: ( - line: 14, - column: 8, - file: "blueprint/router/invalid_paths/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home/:id", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_fc852cc3", - module_path: "app_fc852cc3", - ), - import_path: "crate::handler", - ), - location: ( - line: 15, - column: 8, - file: "blueprint/router/invalid_paths/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home/:home_id", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_fc852cc3", - module_path: "app_fc852cc3", - ), - import_path: "crate::handler", - ), - location: ( - line: 17, - column: 8, - file: "blueprint/router/invalid_paths/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/room/:", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_fc852cc3", - module_path: "app_fc852cc3", - ), - import_path: "crate::handler", - ), - location: ( - line: 19, - column: 8, - file: "blueprint/router/invalid_paths/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/invalid_paths/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/invalid_paths/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml deleted file mode 100644 index 5eb783788..000000000 --- a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_c7a5ef25" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/blueprint.ron deleted file mode 100644 index b1d5f2f26..000000000 --- a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 16, - column: 18, - file: "blueprint/router/request_handlers_can_take_mut_references/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c7a5ef25", - module_path: "app_c7a5ef25", - ), - import_path: "self::build", - ), - location: ( - line: 17, - column: 8, - file: "blueprint/router/request_handlers_can_take_mut_references/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c7a5ef25", - module_path: "app_c7a5ef25", - ), - import_path: "self::handler", - ), - location: ( - line: 18, - column: 8, - file: "blueprint/router/request_handlers_can_take_mut_references/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/request_handlers_can_take_mut_references/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/Cargo.toml deleted file mode 100644 index 1f8ab429e..000000000 --- a/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_c2e83ed5" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/blueprint.ron deleted file mode 100644 index b5df5dedf..000000000 --- a/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/blueprint.ron +++ /dev/null @@ -1,51 +0,0 @@ -( - creation_location: ( - line: 9, - column: 18, - file: "blueprint/router/route_path_is_validated/src/lib.rs", - ), - components: [ - Route(( - path: "", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c2e83ed5", - module_path: "app_c2e83ed5", - ), - import_path: "crate::handler", - ), - location: ( - line: 11, - column: 8, - file: "blueprint/router/route_path_is_validated/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "api", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c2e83ed5", - module_path: "app_c2e83ed5", - ), - import_path: "crate::handler", - ), - location: ( - line: 13, - column: 8, - file: "blueprint/router/route_path_is_validated/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/route_path_is_validated/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/Cargo.toml b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/Cargo.toml deleted file mode 100644 index f92ecec16..000000000 --- a/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_812a13f2" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/blueprint.ron b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/blueprint.ron deleted file mode 100644 index 945dc4d15..000000000 --- a/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/blueprint.ron +++ /dev/null @@ -1,30 +0,0 @@ -( - creation_location: ( - line: 7, - column: 18, - file: "blueprint/router/structs_cannot_be_registered_as_handlers/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_812a13f2", - module_path: "app_812a13f2", - ), - import_path: "crate::Streamer", - ), - location: ( - line: 8, - column: 8, - file: "blueprint/router/structs_cannot_be_registered_as_handlers/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/src/lib.rs b/libs/ui_tests/blueprint/router/structs_cannot_be_registered_as_handlers/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/Cargo.toml deleted file mode 100644 index 367a29485..000000000 --- a/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_af31d59e" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/blueprint.ron b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/blueprint.ron deleted file mode 100644 index 449182593..000000000 --- a/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/blueprint.ron +++ /dev/null @@ -1,47 +0,0 @@ -( - creation_location: ( - line: 20, - column: 18, - file: "blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/lib.rs", - ), - components: [ - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_af31d59e", - module_path: "app_af31d59e", - ), - import_path: "crate::mw", - ), - location: ( - line: 21, - column: 8, - file: "blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_af31d59e", - module_path: "app_af31d59e", - ), - import_path: "crate::handler", - ), - location: ( - line: 22, - column: 8, - file: "blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/src/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/cannot_have_multiple_next_inputs/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/Cargo.toml deleted file mode 100644 index 2adb7a7fc..000000000 --- a/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_0cb36ccc" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/blueprint.ron b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/blueprint.ron deleted file mode 100644 index 467b8eb90..000000000 --- a/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/blueprint.ron +++ /dev/null @@ -1,47 +0,0 @@ -( - creation_location: ( - line: 14, - column: 18, - file: "blueprint/wrapping_middlewares/must_take_next_as_input/src/lib.rs", - ), - components: [ - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_0cb36ccc", - module_path: "app_0cb36ccc", - ), - import_path: "crate::mw", - ), - location: ( - line: 15, - column: 8, - file: "blueprint/wrapping_middlewares/must_take_next_as_input/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_0cb36ccc", - module_path: "app_0cb36ccc", - ), - import_path: "crate::handler", - ), - location: ( - line: 16, - column: 8, - file: "blueprint/wrapping_middlewares/must_take_next_as_input/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/src/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/must_take_next_as_input/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/Cargo.toml deleted file mode 100644 index 85b675158..000000000 --- a/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_3e90eeee" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/blueprint.ron b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/blueprint.ron deleted file mode 100644 index 414e88b79..000000000 --- a/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/blueprint.ron +++ /dev/null @@ -1,47 +0,0 @@ -( - creation_location: ( - line: 31, - column: 18, - file: "blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/lib.rs", - ), - components: [ - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_3e90eeee", - module_path: "app_3e90eeee", - ), - import_path: "crate::mw", - ), - location: ( - line: 32, - column: 8, - file: "blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_3e90eeee", - module_path: "app_3e90eeee", - ), - import_path: "crate::handler", - ), - location: ( - line: 33, - column: 8, - file: "blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/src/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/next_must_take_a_naked_generic_parameter/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml deleted file mode 100644 index afff472fd..000000000 --- a/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_7479eeb2" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron deleted file mode 100644 index c7b4bfaf7..000000000 --- a/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/blueprint.ron +++ /dev/null @@ -1,81 +0,0 @@ -( - creation_location: ( - line: 45, - column: 18, - file: "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - components: [ - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_7479eeb2", - module_path: "app_7479eeb2", - ), - import_path: "crate::generic_wrapping_middleware", - ), - location: ( - line: 46, - column: 8, - file: "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_7479eeb2", - module_path: "app_7479eeb2", - ), - import_path: "crate::doubly_generic_wrapping_middleware", - ), - location: ( - line: 47, - column: 8, - file: "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_7479eeb2", - module_path: "app_7479eeb2", - ), - import_path: "crate::triply_generic_wrapping_middleware", - ), - location: ( - line: 48, - column: 8, - file: "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_7479eeb2", - module_path: "app_7479eeb2", - ), - import_path: "crate::handler", - ), - location: ( - line: 49, - column: 8, - file: "blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs b/libs/ui_tests/blueprint/wrapping_middlewares/wrapping_middlewares_input_parameters_cannot_be_generic/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/Cargo.toml deleted file mode 100644 index 24e1d6e2d..000000000 --- a/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_24d12820" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/blueprint.ron deleted file mode 100644 index 02084b4b8..000000000 --- a/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 17, - column: 18, - file: "borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_24d12820", - module_path: "app_24d12820", - ), - import_path: "self::build", - ), - location: ( - line: 18, - column: 8, - file: "borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_24d12820", - module_path: "app_24d12820", - ), - import_path: "self::handler", - ), - location: ( - line: 19, - column: 8, - file: "borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/cannot_borrow_clonable_request_scoped_as_mut/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/Cargo.toml deleted file mode 100644 index 6adffad6d..000000000 --- a/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_a7783cd8" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/blueprint.ron deleted file mode 100644 index 7a3581b6c..000000000 --- a/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 17, - column: 18, - file: "borrow_checker/cannot_borrow_singletons_as_mut/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_a7783cd8", - module_path: "app_a7783cd8", - ), - import_path: "self::build", - ), - location: ( - line: 18, - column: 8, - file: "borrow_checker/cannot_borrow_singletons_as_mut/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a7783cd8", - module_path: "app_a7783cd8", - ), - import_path: "self::handler", - ), - location: ( - line: 19, - column: 8, - file: "borrow_checker/cannot_borrow_singletons_as_mut/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/cannot_borrow_singletons_as_mut/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/Cargo.toml deleted file mode 100644 index 234378ecb..000000000 --- a/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_75542b02" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/blueprint.ron deleted file mode 100644 index e5fdca9c9..000000000 --- a/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 17, - column: 18, - file: "borrow_checker/cannot_borrow_transients_as_mut/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_75542b02", - module_path: "app_75542b02", - ), - import_path: "self::build", - ), - location: ( - line: 18, - column: 8, - file: "borrow_checker/cannot_borrow_transients_as_mut/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_75542b02", - module_path: "app_75542b02", - ), - import_path: "self::handler", - ), - location: ( - line: 19, - column: 8, - file: "borrow_checker/cannot_borrow_transients_as_mut/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/cannot_borrow_transients_as_mut/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/Cargo.toml deleted file mode 100644 index 9fd7c6781..000000000 --- a/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_23e2eec5" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/blueprint.ron deleted file mode 100644 index 9483698c7..000000000 --- a/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/blueprint.ron +++ /dev/null @@ -1,103 +0,0 @@ -( - creation_location: ( - line: 63, - column: 18, - file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_23e2eec5", - module_path: "app_23e2eec5", - ), - import_path: "crate::a", - ), - location: ( - line: 64, - column: 8, - file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_23e2eec5", - module_path: "app_23e2eec5", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 65, - column: 10, - file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", - ), - )), - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_23e2eec5", - module_path: "app_23e2eec5", - ), - import_path: "crate::b", - ), - location: ( - line: 66, - column: 8, - file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_23e2eec5", - module_path: "app_23e2eec5", - ), - import_path: "crate::c", - ), - location: ( - line: 67, - column: 8, - file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_23e2eec5", - module_path: "app_23e2eec5", - ), - import_path: "crate::handler", - ), - location: ( - line: 68, - column: 8, - file: "borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/control_flow/multiple_consumers_pass_takes_control_flow_into_account_for_errors/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml deleted file mode 100644 index a1cfa8f0d..000000000 --- a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_9717f587" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/blueprint.ron deleted file mode 100644 index 93db13fdd..000000000 --- a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/blueprint.ron +++ /dev/null @@ -1,83 +0,0 @@ -( - creation_location: ( - line: 50, - column: 18, - file: "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_9717f587", - module_path: "app_9717f587", - ), - import_path: "crate::a", - ), - location: ( - line: 51, - column: 8, - file: "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_9717f587", - module_path: "app_9717f587", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 52, - column: 10, - file: "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs", - ), - )), - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_9717f587", - module_path: "app_9717f587", - ), - import_path: "crate::b", - ), - location: ( - line: 53, - column: 8, - file: "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_9717f587", - module_path: "app_9717f587", - ), - import_path: "crate::handler", - ), - location: ( - line: 54, - column: 8, - file: "borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml deleted file mode 100644 index 5c88d7da8..000000000 --- a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_74f21254" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/blueprint.ron deleted file mode 100644 index 803c2032c..000000000 --- a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/blueprint.ron +++ /dev/null @@ -1,110 +0,0 @@ -( - creation_location: ( - line: 58, - column: 18, - file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_74f21254", - module_path: "app_74f21254", - ), - import_path: "crate::a", - ), - location: ( - line: 59, - column: 8, - file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_74f21254", - module_path: "app_74f21254", - ), - import_path: "crate::b", - ), - location: ( - line: 61, - column: 8, - file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_74f21254", - module_path: "app_74f21254", - ), - import_path: "crate::c", - ), - location: ( - line: 63, - column: 8, - file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_74f21254", - module_path: "app_74f21254", - ), - import_path: "crate::d", - ), - location: ( - line: 64, - column: 8, - file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_74f21254", - module_path: "app_74f21254", - ), - import_path: "crate::handler", - ), - location: ( - line: 65, - column: 8, - file: "borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_type_is_copy/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml deleted file mode 100644 index bcaa5f808..000000000 --- a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_e8f51606" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/blueprint.ron deleted file mode 100644 index 977d3e8b9..000000000 --- a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/blueprint.ron +++ /dev/null @@ -1,110 +0,0 @@ -( - creation_location: ( - line: 58, - column: 18, - file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_e8f51606", - module_path: "app_e8f51606", - ), - import_path: "crate::a", - ), - location: ( - line: 59, - column: 8, - file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_e8f51606", - module_path: "app_e8f51606", - ), - import_path: "crate::b", - ), - location: ( - line: 61, - column: 8, - file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_e8f51606", - module_path: "app_e8f51606", - ), - import_path: "crate::c", - ), - location: ( - line: 63, - column: 8, - file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_e8f51606", - module_path: "app_e8f51606", - ), - import_path: "crate::d", - ), - location: ( - line: 64, - column: 8, - file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_e8f51606", - module_path: "app_e8f51606", - ), - import_path: "crate::handler", - ), - location: ( - line: 65, - column: 8, - file: "borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/diamond/diamond_can_be_solved_if_we_can_clone/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/Cargo.toml deleted file mode 100644 index 9e9ea492f..000000000 --- a/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_8ce66b53" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/blueprint.ron deleted file mode 100644 index ebf152fa0..000000000 --- a/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/blueprint.ron +++ /dev/null @@ -1,110 +0,0 @@ -( - creation_location: ( - line: 51, - column: 18, - file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_8ce66b53", - module_path: "app_8ce66b53", - ), - import_path: "crate::a", - ), - location: ( - line: 52, - column: 8, - file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_8ce66b53", - module_path: "app_8ce66b53", - ), - import_path: "crate::b", - ), - location: ( - line: 54, - column: 8, - file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_8ce66b53", - module_path: "app_8ce66b53", - ), - import_path: "crate::c", - ), - location: ( - line: 55, - column: 8, - file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_8ce66b53", - module_path: "app_8ce66b53", - ), - import_path: "crate::d", - ), - location: ( - line: 56, - column: 8, - file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_8ce66b53", - module_path: "app_8ce66b53", - ), - import_path: "crate::handler", - ), - location: ( - line: 57, - column: 8, - file: "borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/diamond/diamond_cannot_be_solved_if_we_cannot_clone/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml deleted file mode 100644 index b4396aba4..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_821d919e" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/blueprint.ron deleted file mode 100644 index a6dd6ee00..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 41, - column: 18, - file: "borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_821d919e", - module_path: "app_821d919e", - ), - import_path: "crate::b", - ), - location: ( - line: 42, - column: 8, - file: "borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_821d919e", - module_path: "app_821d919e", - ), - import_path: "crate::c", - ), - location: ( - line: 43, - column: 8, - file: "borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_821d919e", - module_path: "app_821d919e", - ), - import_path: "crate::handler", - ), - location: ( - line: 44, - column: 8, - file: "borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_framework_type_can_be_moved_twice/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml deleted file mode 100644 index a8516bdc1..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_e1c9a48c" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/blueprint.ron deleted file mode 100644 index a45890ac7..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 46, - column: 18, - file: "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_e1c9a48c", - module_path: "app_e1c9a48c", - ), - import_path: "crate::a", - ), - location: ( - line: 48, - column: 8, - file: "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_e1c9a48c", - module_path: "app_e1c9a48c", - ), - import_path: "crate::b", - ), - location: ( - line: 50, - column: 8, - file: "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_e1c9a48c", - module_path: "app_e1c9a48c", - ), - import_path: "crate::c", - ), - location: ( - line: 51, - column: 8, - file: "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_e1c9a48c", - module_path: "app_e1c9a48c", - ), - import_path: "crate::handler", - ), - location: ( - line: 52, - column: 8, - file: "borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_input_type_can_be_moved_twice/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml deleted file mode 100644 index 7cf80ac96..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_9b6ffdef" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/blueprint.ron deleted file mode 100644 index 0cc5fa402..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 46, - column: 18, - file: "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_9b6ffdef", - module_path: "app_9b6ffdef", - ), - import_path: "crate::a", - ), - location: ( - line: 47, - column: 8, - file: "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_9b6ffdef", - module_path: "app_9b6ffdef", - ), - import_path: "crate::b", - ), - location: ( - line: 49, - column: 8, - file: "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_9b6ffdef", - module_path: "app_9b6ffdef", - ), - import_path: "crate::c", - ), - location: ( - line: 50, - column: 8, - file: "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_9b6ffdef", - module_path: "app_9b6ffdef", - ), - import_path: "crate::handler", - ), - location: ( - line: 51, - column: 8, - file: "borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_clonable_type_can_be_moved_twice/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml deleted file mode 100644 index 6cf649a82..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ba0e5d33" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/blueprint.ron deleted file mode 100644 index 1a3431f92..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 46, - column: 18, - file: "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ba0e5d33", - module_path: "app_ba0e5d33", - ), - import_path: "crate::a", - ), - location: ( - line: 47, - column: 8, - file: "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ba0e5d33", - module_path: "app_ba0e5d33", - ), - import_path: "crate::b", - ), - location: ( - line: 49, - column: 8, - file: "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ba0e5d33", - module_path: "app_ba0e5d33", - ), - import_path: "crate::c", - ), - location: ( - line: 50, - column: 8, - file: "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ba0e5d33", - module_path: "app_ba0e5d33", - ), - import_path: "crate::handler", - ), - location: ( - line: 51, - column: 8, - file: "borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_copy_type_can_be_moved_twice/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/Cargo.toml deleted file mode 100644 index 5fc4481ff..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_53427e7d" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/blueprint.ron deleted file mode 100644 index 6b7ff2f86..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 39, - column: 18, - file: "borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_53427e7d", - module_path: "app_53427e7d", - ), - import_path: "crate::b", - ), - location: ( - line: 40, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_53427e7d", - module_path: "app_53427e7d", - ), - import_path: "crate::c", - ), - location: ( - line: 41, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_53427e7d", - module_path: "app_53427e7d", - ), - import_path: "crate::handler", - ), - location: ( - line: 42, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_framework_type_cannot_be_moved_twice/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/Cargo.toml deleted file mode 100644 index a9a16d5a3..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_335ca652" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/blueprint.ron deleted file mode 100644 index 4ca70f168..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 42, - column: 18, - file: "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_335ca652", - module_path: "app_335ca652", - ), - import_path: "crate::a", - ), - location: ( - line: 44, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_335ca652", - module_path: "app_335ca652", - ), - import_path: "crate::b", - ), - location: ( - line: 45, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_335ca652", - module_path: "app_335ca652", - ), - import_path: "crate::c", - ), - location: ( - line: 46, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_335ca652", - module_path: "app_335ca652", - ), - import_path: "crate::handler", - ), - location: ( - line: 47, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_input_type_cannot_be_moved_twice/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/Cargo.toml deleted file mode 100644 index f42a5a266..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_8ee91948" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/blueprint.ron deleted file mode 100644 index 8b960c25e..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 41, - column: 18, - file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_8ee91948", - module_path: "app_8ee91948", - ), - import_path: "crate::a", - ), - location: ( - line: 42, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_8ee91948", - module_path: "app_8ee91948", - ), - import_path: "crate::b", - ), - location: ( - line: 43, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_8ee91948", - module_path: "app_8ee91948", - ), - import_path: "crate::c", - ), - location: ( - line: 44, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_8ee91948", - module_path: "app_8ee91948", - ), - import_path: "crate::handler", - ), - location: ( - line: 45, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/Cargo.toml deleted file mode 100644 index f34a46758..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_900c9672" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/blueprint.ron deleted file mode 100644 index ee5080e3c..000000000 --- a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/blueprint.ron +++ /dev/null @@ -1,67 +0,0 @@ -( - creation_location: ( - line: 29, - column: 18, - file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_900c9672", - module_path: "app_900c9672", - ), - import_path: "crate::a", - ), - location: ( - line: 30, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_900c9672", - module_path: "app_900c9672", - ), - import_path: "crate::mw", - ), - location: ( - line: 31, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_900c9672", - module_path: "app_900c9672", - ), - import_path: "crate::handler", - ), - location: ( - line: 32, - column: 8, - file: "borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/multiple_consumers/a_non_clonable_type_cannot_be_moved_twice_across_stages/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/mutability/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/mutability/generated_app/Cargo.toml deleted file mode 100644 index 0c384670d..000000000 --- a/libs/ui_tests/borrow_checker/mutability/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_90734139" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/mutability/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/mutability/generated_app/blueprint.ron deleted file mode 100644 index 9f739de00..000000000 --- a/libs/ui_tests/borrow_checker/mutability/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 43, - column: 18, - file: "borrow_checker/mutability/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_90734139", - module_path: "app_90734139", - ), - import_path: "crate::a", - ), - location: ( - line: 44, - column: 8, - file: "borrow_checker/mutability/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_90734139", - module_path: "app_90734139", - ), - import_path: "crate::b", - ), - location: ( - line: 45, - column: 8, - file: "borrow_checker/mutability/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_90734139", - module_path: "app_90734139", - ), - import_path: "crate::handler", - ), - location: ( - line: 46, - column: 8, - file: "borrow_checker/mutability/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/mutability/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/mutability/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/Cargo.toml deleted file mode 100644 index 9d4090e53..000000000 --- a/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_7321b637" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/blueprint.ron deleted file mode 100644 index f16b6c4cd..000000000 --- a/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 47, - column: 18, - file: "borrow_checker/transitive_borrows/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_7321b637", - module_path: "app_7321b637", - ), - import_path: "crate::a", - ), - location: ( - line: 48, - column: 8, - file: "borrow_checker/transitive_borrows/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_7321b637", - module_path: "app_7321b637", - ), - import_path: "crate::b", - ), - location: ( - line: 49, - column: 8, - file: "borrow_checker/transitive_borrows/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_7321b637", - module_path: "app_7321b637", - ), - import_path: "crate::c", - ), - location: ( - line: 50, - column: 8, - file: "borrow_checker/transitive_borrows/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_7321b637", - module_path: "app_7321b637", - ), - import_path: "crate::handler", - ), - location: ( - line: 51, - column: 8, - file: "borrow_checker/transitive_borrows/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/transitive_borrows/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml deleted file mode 100644 index 7d1f73d10..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_802eb683" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/blueprint.ron deleted file mode 100644 index abc53f2c7..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 36, - column: 18, - file: "borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_802eb683", - module_path: "app_802eb683", - ), - import_path: "crate::b", - ), - location: ( - line: 37, - column: 8, - file: "borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_802eb683", - module_path: "app_802eb683", - ), - import_path: "crate::handler", - ), - location: ( - line: 38, - column: 8, - file: "borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_framework_type_is_clonable/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml deleted file mode 100644 index 31bf92b36..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_d2e8db7a" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/blueprint.ron deleted file mode 100644 index add823300..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 41, - column: 18, - file: "borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d2e8db7a", - module_path: "app_d2e8db7a", - ), - import_path: "crate::a", - ), - location: ( - line: 43, - column: 8, - file: "borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d2e8db7a", - module_path: "app_d2e8db7a", - ), - import_path: "crate::b", - ), - location: ( - line: 45, - column: 8, - file: "borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_d2e8db7a", - module_path: "app_d2e8db7a", - ), - import_path: "crate::handler", - ), - location: ( - line: 46, - column: 8, - file: "borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_input_type_is_clonable/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml deleted file mode 100644 index c53cf52b8..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_835fd2b1" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron deleted file mode 100644 index 825be692a..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 41, - column: 18, - file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_835fd2b1", - module_path: "app_835fd2b1", - ), - import_path: "crate::a", - ), - location: ( - line: 42, - column: 8, - file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_835fd2b1", - module_path: "app_835fd2b1", - ), - import_path: "crate::b", - ), - location: ( - line: 44, - column: 8, - file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_835fd2b1", - module_path: "app_835fd2b1", - ), - import_path: "crate::handler", - ), - location: ( - line: 45, - column: 8, - file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml deleted file mode 100644 index a318a759b..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_2546f91e" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/blueprint.ron deleted file mode 100644 index c2c442c27..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 41, - column: 18, - file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_2546f91e", - module_path: "app_2546f91e", - ), - import_path: "crate::a", - ), - location: ( - line: 42, - column: 8, - file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_2546f91e", - module_path: "app_2546f91e", - ), - import_path: "crate::b", - ), - location: ( - line: 44, - column: 8, - file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_2546f91e", - module_path: "app_2546f91e", - ), - import_path: "crate::handler", - ), - location: ( - line: 45, - column: 8, - file: "borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_can_be_solved_if_type_is_copy/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/Cargo.toml deleted file mode 100644 index 4b09040d8..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_3acfbc8e" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/blueprint.ron deleted file mode 100644 index 90b8728ce..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 29, - column: 18, - file: "borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_3acfbc8e", - module_path: "app_3acfbc8e", - ), - import_path: "crate::b", - ), - location: ( - line: 30, - column: 8, - file: "borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_3acfbc8e", - module_path: "app_3acfbc8e", - ), - import_path: "crate::handler", - ), - location: ( - line: 31, - column: 8, - file: "borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_framework_type_is_not_clonable/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/Cargo.toml deleted file mode 100644 index d134f0a54..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_18d45c43" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/blueprint.ron deleted file mode 100644 index 75bb3cff3..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 36, - column: 18, - file: "borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_18d45c43", - module_path: "app_18d45c43", - ), - import_path: "crate::a", - ), - location: ( - line: 38, - column: 8, - file: "borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_18d45c43", - module_path: "app_18d45c43", - ), - import_path: "crate::b", - ), - location: ( - line: 39, - column: 8, - file: "borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_18d45c43", - module_path: "app_18d45c43", - ), - import_path: "crate::handler", - ), - location: ( - line: 40, - column: 8, - file: "borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_input_type_is_not_clonable/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/Cargo.toml deleted file mode 100644 index 2bdb6c6d3..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_24452d94" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/blueprint.ron deleted file mode 100644 index 4420f8fc7..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 36, - column: 18, - file: "borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_24452d94", - module_path: "app_24452d94", - ), - import_path: "crate::a", - ), - location: ( - line: 37, - column: 8, - file: "borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_24452d94", - module_path: "app_24452d94", - ), - import_path: "crate::b", - ), - location: ( - line: 38, - column: 8, - file: "borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_24452d94", - module_path: "app_24452d94", - ), - import_path: "crate::handler", - ), - location: ( - line: 39, - column: 8, - file: "borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_cannot_be_solved_if_type_is_not_clonable/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml deleted file mode 100644 index 9d49a5d00..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_01492b3d" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron deleted file mode 100644 index 36745c98b..000000000 --- a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/blueprint.ron +++ /dev/null @@ -1,67 +0,0 @@ -( - creation_location: ( - line: 43, - column: 18, - file: "borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_01492b3d", - module_path: "app_01492b3d", - ), - import_path: "crate::a", - ), - location: ( - line: 44, - column: 8, - file: "borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_01492b3d", - module_path: "app_01492b3d", - ), - import_path: "crate::mw", - ), - location: ( - line: 46, - column: 8, - file: "borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_01492b3d", - module_path: "app_01492b3d", - ), - import_path: "crate::handler", - ), - location: ( - line: 47, - column: 8, - file: "borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs b/libs/ui_tests/borrow_checker/triangle/triangle_with_middleware_can_be_solved_if_type_is_clonable/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml deleted file mode 100644 index 134aa99ee..000000000 --- a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_56967fe8" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/blueprint.ron b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/blueprint.ron deleted file mode 100644 index a1af6e449..000000000 --- a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/blueprint.ron +++ /dev/null @@ -1,47 +0,0 @@ -( - creation_location: ( - line: 15, - column: 18, - file: "connection_info/connection_info_fallback_happy_path/src/lib.rs", - ), - components: [ - Route(( - path: "/route", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_56967fe8", - module_path: "app_56967fe8", - ), - import_path: "crate::root", - ), - location: ( - line: 16, - column: 8, - file: "connection_info/connection_info_fallback_happy_path/src/lib.rs", - ), - ), - error_handler: None, - )), - FallbackRequestHandler(( - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_56967fe8", - module_path: "app_56967fe8", - ), - import_path: "crate::get_connection_info", - ), - location: ( - line: 17, - column: 8, - file: "connection_info/connection_info_fallback_happy_path/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/src/lib.rs b/libs/ui_tests/connection_info/connection_info_fallback_happy_path/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml deleted file mode 100644 index 45a6950cc..000000000 --- a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_a1f930e1" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/blueprint.ron b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/blueprint.ron deleted file mode 100644 index 826714472..000000000 --- a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/blueprint.ron +++ /dev/null @@ -1,30 +0,0 @@ -( - creation_location: ( - line: 11, - column: 18, - file: "connection_info/connection_info_happy_path/src/lib.rs", - ), - components: [ - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a1f930e1", - module_path: "app_a1f930e1", - ), - import_path: "crate::get_connection_info", - ), - location: ( - line: 12, - column: 8, - file: "connection_info/connection_info_happy_path/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/src/lib.rs b/libs/ui_tests/connection_info/connection_info_happy_path/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml deleted file mode 100644 index bf6dfab12..000000000 --- a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_366b29bf" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/blueprint.ron deleted file mode 100644 index 3cefe0f59..000000000 --- a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/blueprint.ron +++ /dev/null @@ -1,67 +0,0 @@ -( - creation_location: ( - line: 33, - column: 18, - file: "dependency_injection/clone_nodes_are_only_added_where_needed/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_366b29bf", - module_path: "app_366b29bf", - ), - import_path: "crate::Singleton::new", - ), - location: ( - line: 34, - column: 8, - file: "dependency_injection/clone_nodes_are_only_added_where_needed/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_366b29bf", - module_path: "app_366b29bf", - ), - import_path: "crate::mw", - ), - location: ( - line: 36, - column: 8, - file: "dependency_injection/clone_nodes_are_only_added_where_needed/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_366b29bf", - module_path: "app_366b29bf", - ), - import_path: "crate::handler", - ), - location: ( - line: 37, - column: 8, - file: "dependency_injection/clone_nodes_are_only_added_where_needed/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/clone_nodes_are_only_added_where_needed/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/Cargo.toml deleted file mode 100644 index d9c46b9f1..000000000 --- a/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_4bcfa44d" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/blueprint.ron deleted file mode 100644 index ff067eb54..000000000 --- a/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/blueprint.ron +++ /dev/null @@ -1,83 +0,0 @@ -( - creation_location: ( - line: 46, - column: 18, - file: "dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_4bcfa44d", - module_path: "app_4bcfa44d", - ), - import_path: "crate::a", - ), - location: ( - line: 47, - column: 8, - file: "dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_4bcfa44d", - module_path: "app_4bcfa44d", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 48, - column: 10, - file: "dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs", - ), - )), - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_4bcfa44d", - module_path: "app_4bcfa44d", - ), - import_path: "crate::b", - ), - location: ( - line: 49, - column: 8, - file: "dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_4bcfa44d", - module_path: "app_4bcfa44d", - ), - import_path: "crate::handler", - ), - location: ( - line: 50, - column: 8, - file: "dependency_injection/cycles/cycle_across_a_match_statement/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/cycles/cycle_across_a_match_statement/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/Cargo.toml deleted file mode 100644 index ae2656a10..000000000 --- a/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_2480aa2b" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/blueprint.ron deleted file mode 100644 index a20ff4c40..000000000 --- a/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 47, - column: 18, - file: "dependency_injection/cycles/request_scoped_cycles/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_2480aa2b", - module_path: "app_2480aa2b", - ), - import_path: "crate::a", - ), - location: ( - line: 48, - column: 8, - file: "dependency_injection/cycles/request_scoped_cycles/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_2480aa2b", - module_path: "app_2480aa2b", - ), - import_path: "crate::b", - ), - location: ( - line: 49, - column: 8, - file: "dependency_injection/cycles/request_scoped_cycles/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_2480aa2b", - module_path: "app_2480aa2b", - ), - import_path: "crate::c", - ), - location: ( - line: 50, - column: 8, - file: "dependency_injection/cycles/request_scoped_cycles/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_2480aa2b", - module_path: "app_2480aa2b", - ), - import_path: "crate::handler", - ), - location: ( - line: 51, - column: 8, - file: "dependency_injection/cycles/request_scoped_cycles/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/cycles/request_scoped_cycles/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/Cargo.toml deleted file mode 100644 index c6b396414..000000000 --- a/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ca08c5dd" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/blueprint.ron deleted file mode 100644 index b95ccca56..000000000 --- a/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 47, - column: 18, - file: "dependency_injection/cycles/transient_cycles/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ca08c5dd", - module_path: "app_ca08c5dd", - ), - import_path: "crate::a", - ), - location: ( - line: 48, - column: 8, - file: "dependency_injection/cycles/transient_cycles/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ca08c5dd", - module_path: "app_ca08c5dd", - ), - import_path: "crate::b", - ), - location: ( - line: 49, - column: 8, - file: "dependency_injection/cycles/transient_cycles/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ca08c5dd", - module_path: "app_ca08c5dd", - ), - import_path: "crate::c", - ), - location: ( - line: 50, - column: 8, - file: "dependency_injection/cycles/transient_cycles/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ca08c5dd", - module_path: "app_ca08c5dd", - ), - import_path: "crate::handler", - ), - location: ( - line: 51, - column: 8, - file: "dependency_injection/cycles/transient_cycles/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/cycles/transient_cycles/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml deleted file mode 100644 index 9fb448416..000000000 --- a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_40ab089d" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/blueprint.ron deleted file mode 100644 index 8b8699326..000000000 --- a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/blueprint.ron +++ /dev/null @@ -1,84 +0,0 @@ -( - creation_location: ( - line: 40, - column: 18, - file: "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_40ab089d", - module_path: "app_40ab089d", - ), - import_path: "crate::Scoped::new", - ), - location: ( - line: 41, - column: 8, - file: "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_40ab089d", - module_path: "app_40ab089d", - ), - import_path: "crate::mw", - ), - location: ( - line: 43, - column: 8, - file: "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs", - ), - ), - error_handler: None, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_40ab089d", - module_path: "app_40ab089d", - ), - import_path: "crate::mw2", - ), - location: ( - line: 44, - column: 8, - file: "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_40ab089d", - module_path: "app_40ab089d", - ), - import_path: "crate::handler", - ), - location: ( - line: 45, - column: 8, - file: "dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/downstream_code_needs_both_owned_and_ref_to_same_type/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml deleted file mode 100644 index eee59c826..000000000 --- a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ddc3d7f1" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/blueprint.ron deleted file mode 100644 index 8d67eb553..000000000 --- a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 26, - column: 18, - file: "dependency_injection/elided_lifetimes_are_handled/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ddc3d7f1", - module_path: "app_ddc3d7f1", - ), - import_path: "self::A::new", - ), - location: ( - line: 27, - column: 8, - file: "dependency_injection/elided_lifetimes_are_handled/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ddc3d7f1", - module_path: "app_ddc3d7f1", - ), - import_path: "self::Generic::new", - ), - location: ( - line: 28, - column: 8, - file: "dependency_injection/elided_lifetimes_are_handled/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ddc3d7f1", - module_path: "app_ddc3d7f1", - ), - import_path: "self::handler::", - ), - location: ( - line: 29, - column: 8, - file: "dependency_injection/elided_lifetimes_are_handled/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/elided_lifetimes_are_handled/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/Cargo.toml deleted file mode 100644 index 102bdfdf5..000000000 --- a/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_d408236b" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/blueprint.ron deleted file mode 100644 index fa5553aa3..000000000 --- a/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 24, - column: 18, - file: "dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d408236b", - module_path: "app_d408236b", - ), - import_path: "crate::a", - ), - location: ( - line: 25, - column: 8, - file: "dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d408236b", - module_path: "app_d408236b", - ), - import_path: "crate::b", - ), - location: ( - line: 26, - column: 8, - file: "dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_d408236b", - module_path: "app_d408236b", - ), - import_path: "crate::handler", - ), - location: ( - line: 27, - column: 8, - file: "dependency_injection/lifecycles/non_static_references_cannot_be_singletons/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/lifecycles/non_static_references_cannot_be_singletons/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/Cargo.toml deleted file mode 100644 index 53005a5cb..000000000 --- a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_7c78acb2" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/blueprint.ron deleted file mode 100644 index ec41b92e4..000000000 --- a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 29, - column: 18, - file: "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_7c78acb2", - module_path: "app_7c78acb2", - ), - import_path: "crate::a", - ), - location: ( - line: 30, - column: 8, - file: "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_7c78acb2", - module_path: "app_7c78acb2", - ), - import_path: "crate::b", - ), - location: ( - line: 31, - column: 8, - file: "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_7c78acb2", - module_path: "app_7c78acb2", - ), - import_path: "crate::c", - ), - location: ( - line: 32, - column: 8, - file: "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_7c78acb2", - module_path: "app_7c78acb2", - ), - import_path: "crate::handler", - ), - location: ( - line: 33, - column: 8, - file: "dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_depend_on_request_scoped/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/Cargo.toml deleted file mode 100644 index 7af7af895..000000000 --- a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_381916a7" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/blueprint.ron deleted file mode 100644 index 479f36bf5..000000000 --- a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 25, - column: 18, - file: "dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_381916a7", - module_path: "app_381916a7", - ), - import_path: "self::a", - ), - location: ( - line: 26, - column: 8, - file: "dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_381916a7", - module_path: "app_381916a7", - ), - import_path: "self::B::new", - ), - location: ( - line: 27, - column: 8, - file: "dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: Some(CloneIfNecessary), - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_381916a7", - module_path: "app_381916a7", - ), - import_path: "self::handler", - ), - location: ( - line: 28, - column: 8, - file: "dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/lifecycles/singletons_cannot_have_non_static_lifetime_parameters/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/Cargo.toml deleted file mode 100644 index cad7243b0..000000000 --- a/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ce0a2170" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/blueprint.ron deleted file mode 100644 index cc86c5788..000000000 --- a/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/blueprint.ron +++ /dev/null @@ -1,30 +0,0 @@ -( - creation_location: ( - line: 11, - column: 18, - file: "dependency_injection/missing_handler_dependency/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ce0a2170", - module_path: "app_ce0a2170", - ), - import_path: "crate::stream_file", - ), - location: ( - line: 12, - column: 8, - file: "dependency_injection/missing_handler_dependency/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/missing_handler_dependency/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/Cargo.toml deleted file mode 100644 index d5dedc7cb..000000000 --- a/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_67306117" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/blueprint.ron deleted file mode 100644 index 28b3ad2cf..000000000 --- a/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 20, - column: 18, - file: "dependency_injection/missing_singleton_dependency/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_67306117", - module_path: "app_67306117", - ), - import_path: "crate::b", - ), - location: ( - line: 21, - column: 8, - file: "dependency_injection/missing_singleton_dependency/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_67306117", - module_path: "app_67306117", - ), - import_path: "crate::handler", - ), - location: ( - line: 22, - column: 8, - file: "dependency_injection/missing_singleton_dependency/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/missing_singleton_dependency/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml deleted file mode 100644 index 1b2e21a60..000000000 --- a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_8b5f0867" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/blueprint.ron deleted file mode 100644 index 4101f6c82..000000000 --- a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/blueprint.ron +++ /dev/null @@ -1,104 +0,0 @@ -( - creation_location: ( - line: 35, - column: 18, - file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_8b5f0867", - module_path: "app_8b5f0867", - ), - import_path: "crate::Singleton::new", - ), - location: ( - line: 36, - column: 8, - file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_8b5f0867", - module_path: "app_8b5f0867", - ), - import_path: "crate::request_scoped", - ), - location: ( - line: 37, - column: 8, - file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_8b5f0867", - module_path: "app_8b5f0867", - ), - import_path: "crate::wrap", - ), - location: ( - line: 38, - column: 8, - file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_8b5f0867", - module_path: "app_8b5f0867", - ), - import_path: "crate::post", - ), - location: ( - line: 39, - column: 8, - file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_8b5f0867", - module_path: "app_8b5f0867", - ), - import_path: "crate::handler", - ), - location: ( - line: 40, - column: 8, - file: "dependency_injection/next_state_is_populated_correctly/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/next_state_is_populated_correctly/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/Cargo.toml deleted file mode 100644 index fa30ae30a..000000000 --- a/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_f1383503" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/blueprint.ron deleted file mode 100644 index a2c3c9832..000000000 --- a/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 18, - column: 18, - file: "dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_f1383503", - module_path: "app_f1383503", - ), - import_path: "crate::tied", - ), - location: ( - line: 19, - column: 8, - file: "dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_f1383503", - module_path: "app_f1383503", - ), - import_path: "crate::handler", - ), - location: ( - line: 20, - column: 8, - file: "dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/pavex_honors_the_restrictions_on_generics_introduced_by_constructors/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml deleted file mode 100644 index 97e49f5d0..000000000 --- a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_c266691d" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/blueprint.ron deleted file mode 100644 index 75dfaec5f..000000000 --- a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 30, - column: 18, - file: "dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c266691d", - module_path: "app_c266691d", - ), - import_path: "crate::Singleton::new", - ), - location: ( - line: 31, - column: 8, - file: "dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c266691d", - module_path: "app_c266691d", - ), - import_path: "crate::request_scoped", - ), - location: ( - line: 32, - column: 8, - file: "dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c266691d", - module_path: "app_c266691d", - ), - import_path: "crate::transient", - ), - location: ( - line: 33, - column: 8, - file: "dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c266691d", - module_path: "app_c266691d", - ), - import_path: "crate::stream_file", - ), - location: ( - line: 34, - column: 8, - file: "dependency_injection/references_to_constructible_types_are_allowed/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/references_to_constructible_types_are_allowed/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/Cargo.toml b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/Cargo.toml deleted file mode 100644 index f14dee838..000000000 --- a/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_d238c5d8" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/blueprint.ron b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/blueprint.ron deleted file mode 100644 index d9befcdbf..000000000 --- a/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/blueprint.ron +++ /dev/null @@ -1,343 +0,0 @@ -( - creation_location: ( - line: 73, - column: 18, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - components: [ - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 75, - column: 22, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::error", - ), - location: ( - line: 76, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::response", - ), - location: ( - line: 77, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::request_head", - ), - location: ( - line: 78, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::allowed_methods", - ), - location: ( - line: 79, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::raw_incoming_body", - ), - location: ( - line: 80, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::matched_path_pattern", - ), - location: ( - line: 81, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::raw_path_params", - ), - location: ( - line: 82, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::connection_info", - ), - location: ( - line: 83, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 74, - column: 8, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 87, - column: 22, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::error_ref", - ), - location: ( - line: 88, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::response_ref", - ), - location: ( - line: 89, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::request_head_ref", - ), - location: ( - line: 90, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::allowed_methods_ref", - ), - location: ( - line: 91, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::raw_incoming_body_ref", - ), - location: ( - line: 92, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::matched_path_pattern_ref", - ), - location: ( - line: 93, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d238c5d8", - module_path: "app_d238c5d8", - ), - import_path: "crate::raw_path_params_ref", - ), - location: ( - line: 97, - column: 12, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 86, - column: 8, - file: "dependency_injection/some_types_cannot_be_constructed/src/lib.rs", - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/src/lib.rs b/libs/ui_tests/dependency_injection/some_types_cannot_be_constructed/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/Cargo.toml deleted file mode 100644 index 611e59ba0..000000000 --- a/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_f6a54ba5" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/blueprint.ron b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/blueprint.ron deleted file mode 100644 index a220436f0..000000000 --- a/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/blueprint.ron +++ /dev/null @@ -1,112 +0,0 @@ -( - creation_location: ( - line: 41, - column: 18, - file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_f6a54ba5", - module_path: "app_f6a54ba5", - ), - import_path: "crate::a", - ), - location: ( - line: 42, - column: 8, - file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_f6a54ba5", - module_path: "app_f6a54ba5", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 43, - column: 10, - file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", - ), - )), - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_f6a54ba5", - module_path: "app_f6a54ba5", - ), - import_path: "crate::b", - ), - location: ( - line: 44, - column: 8, - file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_f6a54ba5", - module_path: "app_f6a54ba5", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 45, - column: 10, - file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", - ), - )), - lints: {}, - )), - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_f6a54ba5", - module_path: "app_f6a54ba5", - ), - import_path: "crate::error_observer", - ), - location: ( - line: 46, - column: 8, - file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", - ), - ), - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_f6a54ba5", - module_path: "app_f6a54ba5", - ), - import_path: "crate::handler", - ), - location: ( - line: 47, - column: 8, - file: "error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observer_cannot_depend_directly_on_fallible_constructors/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/Cargo.toml deleted file mode 100644 index b22b78278..000000000 --- a/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_01bbcc3d" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/blueprint.ron b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/blueprint.ron deleted file mode 100644 index b020691db..000000000 --- a/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/blueprint.ron +++ /dev/null @@ -1,132 +0,0 @@ -( - creation_location: ( - line: 46, - column: 18, - file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_01bbcc3d", - module_path: "app_01bbcc3d", - ), - import_path: "crate::a", - ), - location: ( - line: 47, - column: 8, - file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_01bbcc3d", - module_path: "app_01bbcc3d", - ), - import_path: "crate::b", - ), - location: ( - line: 48, - column: 8, - file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_01bbcc3d", - module_path: "app_01bbcc3d", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 49, - column: 10, - file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", - ), - )), - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_01bbcc3d", - module_path: "app_01bbcc3d", - ), - import_path: "crate::c", - ), - location: ( - line: 50, - column: 8, - file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_01bbcc3d", - module_path: "app_01bbcc3d", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 51, - column: 10, - file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", - ), - )), - lints: {}, - )), - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_01bbcc3d", - module_path: "app_01bbcc3d", - ), - import_path: "crate::error_observer", - ), - location: ( - line: 52, - column: 8, - file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", - ), - ), - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_01bbcc3d", - module_path: "app_01bbcc3d", - ), - import_path: "crate::handler", - ), - location: ( - line: 53, - column: 8, - file: "error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observer_cannot_depend_transitively_on_fallible_constructors/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml deleted file mode 100644 index 647042ec5..000000000 --- a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_00ed62be" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/blueprint.ron b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/blueprint.ron deleted file mode 100644 index 07944a281..000000000 --- a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/blueprint.ron +++ /dev/null @@ -1,79 +0,0 @@ -( - creation_location: ( - line: 40, - column: 18, - file: "error_observers/error_observer_with_generic_error/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_00ed62be", - module_path: "app_00ed62be", - ), - import_path: "crate::constructor", - ), - location: ( - line: 41, - column: 8, - file: "error_observers/error_observer_with_generic_error/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_00ed62be", - module_path: "app_00ed62be", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 42, - column: 10, - file: "error_observers/error_observer_with_generic_error/src/lib.rs", - ), - )), - lints: {}, - )), - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_00ed62be", - module_path: "app_00ed62be", - ), - import_path: "crate::error_observer", - ), - location: ( - line: 43, - column: 8, - file: "error_observers/error_observer_with_generic_error/src/lib.rs", - ), - ), - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_00ed62be", - module_path: "app_00ed62be", - ), - import_path: "crate::handler", - ), - location: ( - line: 44, - column: 8, - file: "error_observers/error_observer_with_generic_error/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observer_with_generic_error/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml deleted file mode 100644 index 571db8ede..000000000 --- a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_028e5d85" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/blueprint.ron b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/blueprint.ron deleted file mode 100644 index 1a6c807cb..000000000 --- a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/blueprint.ron +++ /dev/null @@ -1,99 +0,0 @@ -( - creation_location: ( - line: 42, - column: 18, - file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_028e5d85", - module_path: "app_028e5d85", - ), - import_path: "crate::a", - ), - location: ( - line: 43, - column: 8, - file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_028e5d85", - module_path: "app_028e5d85", - ), - import_path: "crate::b", - ), - location: ( - line: 44, - column: 8, - file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_028e5d85", - module_path: "app_028e5d85", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 45, - column: 10, - file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", - ), - )), - lints: {}, - )), - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_028e5d85", - module_path: "app_028e5d85", - ), - import_path: "crate::error_observer", - ), - location: ( - line: 46, - column: 8, - file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", - ), - ), - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_028e5d85", - module_path: "app_028e5d85", - ), - import_path: "crate::handler", - ), - location: ( - line: 47, - column: 8, - file: "error_observers/error_observers_can_depend_on_fallible_singletons/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observers_can_depend_on_fallible_singletons/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml deleted file mode 100644 index 25824c51d..000000000 --- a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_0ca8edfa" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/blueprint.ron b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/blueprint.ron deleted file mode 100644 index 179b38c78..000000000 --- a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/blueprint.ron +++ /dev/null @@ -1,115 +0,0 @@ -( - creation_location: ( - line: 45, - column: 18, - file: "error_observers/error_observers_happy_path/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_0ca8edfa", - module_path: "app_0ca8edfa", - ), - import_path: "crate::a", - ), - location: ( - line: 46, - column: 8, - file: "error_observers/error_observers_happy_path/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_0ca8edfa", - module_path: "app_0ca8edfa", - ), - import_path: "crate::b", - ), - location: ( - line: 47, - column: 8, - file: "error_observers/error_observers_happy_path/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_0ca8edfa", - module_path: "app_0ca8edfa", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 48, - column: 10, - file: "error_observers/error_observers_happy_path/src/lib.rs", - ), - )), - lints: {}, - )), - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_0ca8edfa", - module_path: "app_0ca8edfa", - ), - import_path: "crate::error_observer", - ), - location: ( - line: 49, - column: 8, - file: "error_observers/error_observers_happy_path/src/lib.rs", - ), - ), - )), - ErrorObserver(( - error_observer: ( - callable: ( - registered_at: ( - crate_name: "app_0ca8edfa", - module_path: "app_0ca8edfa", - ), - import_path: "crate::error_observer2", - ), - location: ( - line: 50, - column: 8, - file: "error_observers/error_observers_happy_path/src/lib.rs", - ), - ), - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_0ca8edfa", - module_path: "app_0ca8edfa", - ), - import_path: "crate::handler", - ), - location: ( - line: 51, - column: 8, - file: "error_observers/error_observers_happy_path/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/src/lib.rs b/libs/ui_tests/error_observers/error_observers_happy_path/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/generated_app/Cargo.toml b/libs/ui_tests/generated_app/Cargo.toml deleted file mode 100644 index 233407034..000000000 --- a/libs/ui_tests/generated_app/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "application" -version = "0.1.0" -edition = "2021" - -[dependencies] -app_9717f587 = { version = "0.1.0", path = "../borrow_checker/control_flow/you_can_consume_a_non_cloneable_type_from_two_different_control_flow_branches" } -http = "1.1.0" -hyper = "1.4.1" -pavex = { version = "0.1.48", path = "../../pavex" } -pavex_matchit = "0.7.4" -thiserror = "1.0.63" diff --git a/libs/ui_tests/generated_app/src/lib.rs b/libs/ui_tests/generated_app/src/lib.rs deleted file mode 100644 index 39712ae5b..000000000 --- a/libs/ui_tests/generated_app/src/lib.rs +++ /dev/null @@ -1,166 +0,0 @@ -//! 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("/home", 0u32).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_1::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::GET => route_0::entrypoint().await, - _ => { - let allowed_methods: pavex::router::AllowedMethods = pavex::router::MethodAllowList::from_iter([ - pavex::http::Method::GET, - ]) - .into(); - route_1::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_9717f587::a(); - let v1 = match v0 { - Ok(ok) => ok, - Err(v1) => { - return { - let v2 = app_9717f587::b(); - let v3 = app_9717f587::error_handler(&v1, v2); - ::into_response( - v3, - ) - }; - } - }; - let v2 = app_9717f587::b(); - let v3 = app_9717f587::handler(v1, v2); - ::into_response(v3) - } - 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<'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_1::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) - } - } -} diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml deleted file mode 100644 index 78384d939..000000000 --- a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_e628417e" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/blueprint.ron b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/blueprint.ron deleted file mode 100644 index 4c6d4dfb4..000000000 --- a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/blueprint.ron +++ /dev/null @@ -1,654 +0,0 @@ -( - creation_location: ( - line: 30, - column: 18, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - components: [ - PrebuiltType(( - input: ( - type_: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "self::Spy", - ), - location: ( - line: 31, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - cloning_strategy: None, - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 40, - column: 18, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - components: [ - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::first", - ), - location: ( - line: 41, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second", - ), - location: ( - line: 42, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::first_post", - ), - location: ( - line: 43, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second_post", - ), - location: ( - line: 44, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::first_pre", - ), - location: ( - line: 45, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second_pre", - ), - location: ( - line: 46, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/top_level", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::handler", - ), - location: ( - line: 47, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 32, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 52, - column: 18, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - components: [ - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::first", - ), - location: ( - line: 53, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::first_post", - ), - location: ( - line: 54, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::first_pre", - ), - location: ( - line: 55, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/after_handler", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::handler", - ), - location: ( - line: 56, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second", - ), - location: ( - line: 57, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second_pre", - ), - location: ( - line: 58, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second_post", - ), - location: ( - line: 59, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 33, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 64, - column: 18, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - components: [ - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::first", - ), - location: ( - line: 65, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::first_post", - ), - location: ( - line: 66, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::early_return_pre", - ), - location: ( - line: 67, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second", - ), - location: ( - line: 68, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second_pre", - ), - location: ( - line: 69, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second_post", - ), - location: ( - line: 70, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/early_return", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::handler", - ), - location: ( - line: 71, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 34, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 76, - column: 18, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - components: [ - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::first", - ), - location: ( - line: 77, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::first_pre", - ), - location: ( - line: 78, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::first_post", - ), - location: ( - line: 79, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - NestedBlueprint(( - blueprint: ( - creation_location: ( - line: 81, - column: 22, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - components: [ - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second", - ), - location: ( - line: 82, - column: 12, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second_post", - ), - location: ( - line: 83, - column: 12, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::second_pre", - ), - location: ( - line: 84, - column: 12, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/nested", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::handler", - ), - location: ( - line: 85, - column: 12, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 80, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::third", - ), - location: ( - line: 88, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::third_pre", - ), - location: ( - line: 89, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_e628417e", - module_path: "app_e628417e", - ), - import_path: "crate::third_post", - ), - location: ( - line: 90, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - ), - error_handler: None, - )), - ], - ), - path_prefix: None, - nesting_location: ( - line: 35, - column: 8, - file: "middlewares/middlewares_execution_order/src/lib.rs", - ), - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/src/lib.rs b/libs/ui_tests/middlewares/middlewares_execution_order/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml deleted file mode 100644 index 007cb731e..000000000 --- a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_dc1710a5" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/blueprint.ron b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/blueprint.ron deleted file mode 100644 index a6e4339e5..000000000 --- a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/blueprint.ron +++ /dev/null @@ -1,107 +0,0 @@ -( - creation_location: ( - line: 38, - column: 18, - file: "middlewares/next_handles_lifetimes/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_dc1710a5", - module_path: "app_dc1710a5", - ), - import_path: "crate::a", - ), - location: ( - line: 39, - column: 8, - file: "middlewares/next_handles_lifetimes/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_dc1710a5", - module_path: "app_dc1710a5", - ), - import_path: "crate::b", - ), - location: ( - line: 40, - column: 8, - file: "middlewares/next_handles_lifetimes/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_dc1710a5", - module_path: "app_dc1710a5", - ), - import_path: "crate::c", - ), - location: ( - line: 41, - column: 8, - file: "middlewares/next_handles_lifetimes/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_dc1710a5", - module_path: "app_dc1710a5", - ), - import_path: "crate::mw", - ), - location: ( - line: 42, - column: 8, - file: "middlewares/next_handles_lifetimes/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_dc1710a5", - module_path: "app_dc1710a5", - ), - import_path: "crate::handler", - ), - location: ( - line: 43, - column: 8, - file: "middlewares/next_handles_lifetimes/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/src/lib.rs b/libs/ui_tests/middlewares/next_handles_lifetimes/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml deleted file mode 100644 index c578c85a9..000000000 --- a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_db1cbdff" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/blueprint.ron b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/blueprint.ron deleted file mode 100644 index 31296c9f2..000000000 --- a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/blueprint.ron +++ /dev/null @@ -1,84 +0,0 @@ -( - creation_location: ( - line: 30, - column: 18, - file: "middlewares/next_handles_mut_references/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_db1cbdff", - module_path: "app_db1cbdff", - ), - import_path: "crate::a", - ), - location: ( - line: 31, - column: 8, - file: "middlewares/next_handles_mut_references/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_db1cbdff", - module_path: "app_db1cbdff", - ), - import_path: "crate::post", - ), - location: ( - line: 32, - column: 8, - file: "middlewares/next_handles_mut_references/src/lib.rs", - ), - ), - error_handler: None, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_db1cbdff", - module_path: "app_db1cbdff", - ), - import_path: "crate::mw", - ), - location: ( - line: 33, - column: 8, - file: "middlewares/next_handles_mut_references/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_db1cbdff", - module_path: "app_db1cbdff", - ), - import_path: "crate::handler", - ), - location: ( - line: 34, - column: 8, - file: "middlewares/next_handles_mut_references/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/src/lib.rs b/libs/ui_tests/middlewares/next_handles_mut_references/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml deleted file mode 100644 index e7971300a..000000000 --- a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_4b6f5359" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/blueprint.ron b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/blueprint.ron deleted file mode 100644 index 8f5f7b683..000000000 --- a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/blueprint.ron +++ /dev/null @@ -1,101 +0,0 @@ -( - creation_location: ( - line: 30, - column: 18, - file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_4b6f5359", - module_path: "app_4b6f5359", - ), - import_path: "crate::a", - ), - location: ( - line: 31, - column: 8, - file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - PreProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_4b6f5359", - module_path: "app_4b6f5359", - ), - import_path: "crate::pre", - ), - location: ( - line: 32, - column: 8, - file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", - ), - ), - error_handler: None, - )), - PostProcessingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_4b6f5359", - module_path: "app_4b6f5359", - ), - import_path: "crate::post", - ), - location: ( - line: 33, - column: 8, - file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", - ), - ), - error_handler: None, - )), - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_4b6f5359", - module_path: "app_4b6f5359", - ), - import_path: "crate::wrap", - ), - location: ( - line: 34, - column: 8, - file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_4b6f5359", - module_path: "app_4b6f5359", - ), - import_path: "crate::handler", - ), - location: ( - line: 35, - column: 8, - file: "middlewares/request_scoped_state_is_shared_correctly_among_middlewares/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/src/lib.rs b/libs/ui_tests/middlewares/request_scoped_state_is_shared_correctly_among_middlewares/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml deleted file mode 100644 index 7fb6b164d..000000000 --- a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_c1ac8ad4" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/blueprint.ron b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/blueprint.ron deleted file mode 100644 index 78123842c..000000000 --- a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/blueprint.ron +++ /dev/null @@ -1,105 +0,0 @@ -( - creation_location: ( - line: 35, - column: 18, - file: "path_parameters/path_parameters_happy_path/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c1ac8ad4", - module_path: "app_c1ac8ad4", - ), - import_path: "pavex::request::path::PathParams::extract", - ), - location: ( - line: 36, - column: 8, - file: "path_parameters/path_parameters_happy_path/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_c1ac8ad4", - module_path: "app_c1ac8ad4", - ), - import_path: "pavex::request::path::errors::ExtractPathParamsError::into_response", - ), - location: ( - line: 40, - column: 6, - file: "path_parameters/path_parameters_happy_path/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/home/:home_id", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c1ac8ad4", - module_path: "app_c1ac8ad4", - ), - import_path: "crate::get_home", - ), - location: ( - line: 43, - column: 8, - file: "path_parameters/path_parameters_happy_path/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/home/:home_id/room/:room_id", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c1ac8ad4", - module_path: "app_c1ac8ad4", - ), - import_path: "crate::get_room", - ), - location: ( - line: 44, - column: 8, - file: "path_parameters/path_parameters_happy_path/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/town/*town", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c1ac8ad4", - module_path: "app_c1ac8ad4", - ), - import_path: "crate::get_town", - ), - location: ( - line: 45, - column: 8, - file: "path_parameters/path_parameters_happy_path/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/src/lib.rs b/libs/ui_tests/path_parameters/path_parameters_happy_path/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/Cargo.toml b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/Cargo.toml deleted file mode 100644 index be8612b90..000000000 --- a/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_c51a0844" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/blueprint.ron b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/blueprint.ron deleted file mode 100644 index 66b42de16..000000000 --- a/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/blueprint.ron +++ /dev/null @@ -1,105 +0,0 @@ -( - creation_location: ( - line: 37, - column: 18, - file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_c51a0844", - module_path: "app_c51a0844", - ), - import_path: "pavex::request::path::PathParams::extract", - ), - location: ( - line: 38, - column: 8, - file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_c51a0844", - module_path: "app_c51a0844", - ), - import_path: "pavex::request::path::errors::ExtractPathParamsError::into_response", - ), - location: ( - line: 42, - column: 6, - file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/a/:x", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c51a0844", - module_path: "app_c51a0844", - ), - import_path: "crate::missing_one", - ), - location: ( - line: 45, - column: 8, - file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/b/:x", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c51a0844", - module_path: "app_c51a0844", - ), - import_path: "crate::missing_two", - ), - location: ( - line: 46, - column: 8, - file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/c", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_c51a0844", - module_path: "app_c51a0844", - ), - import_path: "crate::no_path_params", - ), - location: ( - line: 47, - column: 8, - file: "path_parameters/path_parameters_non_existing_fields/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/src/lib.rs b/libs/ui_tests/path_parameters/path_parameters_non_existing_fields/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/Cargo.toml b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/Cargo.toml deleted file mode 100644 index f9d58d581..000000000 --- a/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_53b2f5d8" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/blueprint.ron b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/blueprint.ron deleted file mode 100644 index ec7c242d7..000000000 --- a/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/blueprint.ron +++ /dev/null @@ -1,189 +0,0 @@ -( - creation_location: ( - line: 54, - column: 18, - file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_53b2f5d8", - module_path: "app_53b2f5d8", - ), - import_path: "pavex::request::path::PathParams::extract", - ), - location: ( - line: 55, - column: 8, - file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_53b2f5d8", - module_path: "app_53b2f5d8", - ), - import_path: "pavex::request::path::errors::ExtractPathParamsError::into_response", - ), - location: ( - line: 59, - column: 6, - file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/a/:x", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_53b2f5d8", - module_path: "app_53b2f5d8", - ), - import_path: "crate::primitive", - ), - location: ( - line: 62, - column: 8, - file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/b/:x/:y", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_53b2f5d8", - module_path: "app_53b2f5d8", - ), - import_path: "crate::tuple", - ), - location: ( - line: 63, - column: 8, - file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/c/:x/:z", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_53b2f5d8", - module_path: "app_53b2f5d8", - ), - import_path: "crate::slice_ref", - ), - location: ( - line: 64, - column: 8, - file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/d/:x/:y", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_53b2f5d8", - module_path: "app_53b2f5d8", - ), - import_path: "crate::reference::", - ), - location: ( - line: 65, - column: 8, - file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/e/:x/:y", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_53b2f5d8", - module_path: "app_53b2f5d8", - ), - import_path: "crate::enum_", - ), - location: ( - line: 66, - column: 8, - file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/f/:x/:y", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_53b2f5d8", - module_path: "app_53b2f5d8", - ), - import_path: "crate::tuple_struct", - ), - location: ( - line: 67, - column: 8, - file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/g/:x/:y", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_53b2f5d8", - module_path: "app_53b2f5d8", - ), - import_path: "crate::unit_struct", - ), - location: ( - line: 68, - column: 8, - file: "path_parameters/path_parameters_unsupported_types/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/src/lib.rs b/libs/ui_tests/path_parameters/path_parameters_unsupported_types/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/Cargo.toml b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/Cargo.toml deleted file mode 100644 index 35582909f..000000000 --- a/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_700defb2" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/blueprint.ron b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/blueprint.ron deleted file mode 100644 index d2303c02b..000000000 --- a/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/blueprint.ron +++ /dev/null @@ -1,30 +0,0 @@ -( - creation_location: ( - line: 7, - column: 18, - file: "reflection/a_fix_is_suggested_for_function_invocations/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "POST", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_700defb2", - module_path: "app_700defb2", - ), - import_path: "self::my_f()", - ), - location: ( - line: 8, - column: 8, - file: "reflection/a_fix_is_suggested_for_function_invocations/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/src/lib.rs b/libs/ui_tests/reflection/a_fix_is_suggested_for_function_invocations/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml deleted file mode 100644 index 9fdf49ac7..000000000 --- a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ca963e92" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/blueprint.ron b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/blueprint.ron deleted file mode 100644 index 18f9313c9..000000000 --- a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/blueprint.ron +++ /dev/null @@ -1,30 +0,0 @@ -( - creation_location: ( - line: 10, - column: 18, - file: "reflection/ambiguous_dependency_version_is_handled/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ca963e92", - module_path: "app_ca963e92", - ), - import_path: "crate::handler", - ), - location: ( - line: 11, - column: 8, - file: "reflection/ambiguous_dependency_version_is_handled/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/src/lib.rs b/libs/ui_tests/reflection/ambiguous_dependency_version_is_handled/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml deleted file mode 100644 index c1fe0d1c3..000000000 --- a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_933292bd" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/blueprint.ron deleted file mode 100644 index b7ce6c21a..000000000 --- a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 18, - column: 18, - file: "reflection/arc_singletons_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_933292bd", - module_path: "app_933292bd", - ), - import_path: "crate::constructor", - ), - location: ( - line: 19, - column: 8, - file: "reflection/arc_singletons_are_supported/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_933292bd", - module_path: "app_933292bd", - ), - import_path: "crate::handler", - ), - location: ( - line: 20, - column: 8, - file: "reflection/arc_singletons_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/arc_singletons_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml deleted file mode 100644 index ced7900cc..000000000 --- a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_88bca0dc" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/blueprint.ron deleted file mode 100644 index 673465497..000000000 --- a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,93 +0,0 @@ -( - creation_location: ( - line: 26, - column: 18, - file: "reflection/common_response_types_are_supported/src/lib.rs", - ), - components: [ - Route(( - path: "/response", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_88bca0dc", - module_path: "app_88bca0dc", - ), - import_path: "crate::response", - ), - location: ( - line: 27, - column: 8, - file: "reflection/common_response_types_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/status_code", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_88bca0dc", - module_path: "app_88bca0dc", - ), - import_path: "crate::status_code", - ), - location: ( - line: 28, - column: 8, - file: "reflection/common_response_types_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/parts", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_88bca0dc", - module_path: "app_88bca0dc", - ), - import_path: "crate::parts", - ), - location: ( - line: 29, - column: 8, - file: "reflection/common_response_types_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/head", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_88bca0dc", - module_path: "app_88bca0dc", - ), - import_path: "crate::response_head", - ), - location: ( - line: 30, - column: 8, - file: "reflection/common_response_types_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/common_response_types_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml deleted file mode 100644 index 66a79b9f9..000000000 --- a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_39415e2f" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/blueprint.ron b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/blueprint.ron deleted file mode 100644 index 158bdee28..000000000 --- a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 10, - column: 18, - file: "reflection/crate_resolution/dependencies_can_register_local_items/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "dep_39415e2f", - module_path: "dep_39415e2f", - ), - import_path: "crate::new_logger", - ), - location: ( - line: 11, - column: 8, - file: "reflection/crate_resolution/dependencies_can_register_local_items/ephemeral_deps/dep/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_39415e2f", - module_path: "app_39415e2f", - ), - import_path: "crate::handler", - ), - location: ( - line: 12, - column: 8, - file: "reflection/crate_resolution/dependencies_can_register_local_items/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/dependencies_can_register_local_items/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml deleted file mode 100644 index af839322a..000000000 --- a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_cb7427d1" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/blueprint.ron deleted file mode 100644 index 57cfbc0c4..000000000 --- a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 20, - column: 18, - file: "reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_cb7427d1", - module_path: "app_cb7427d1", - ), - import_path: "crate::header1", - ), - location: ( - line: 21, - column: 8, - file: "reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_cb7427d1", - module_path: "app_cb7427d1", - ), - import_path: "crate::header2", - ), - location: ( - line: 22, - column: 8, - file: "reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_cb7427d1", - module_path: "app_cb7427d1", - ), - import_path: "crate::stream_file", - ), - location: ( - line: 23, - column: 8, - file: "reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/multiple_versions_for_the_same_crate_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/Cargo.toml deleted file mode 100644 index e73a61adb..000000000 --- a/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_3e2693d0" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/blueprint.ron b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/blueprint.ron deleted file mode 100644 index 2af5f73cf..000000000 --- a/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 10, - column: 18, - file: "reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_3e2693d0", - module_path: "app_3e2693d0", - ), - import_path: "new_logger", - ), - location: ( - line: 11, - column: 8, - file: "reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_3e2693d0", - module_path: "app_3e2693d0", - ), - import_path: "crate::handler", - ), - location: ( - line: 12, - column: 8, - file: "reflection/crate_resolution/remote_callable_paths_must_be_absolute/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/remote_callable_paths_must_be_absolute/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/Cargo.toml deleted file mode 100644 index cb2a21490..000000000 --- a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_11a9a819" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/renamed_dependencies_can_register_local_items/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml deleted file mode 100644 index d165bfac2..000000000 --- a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_a0f4586a" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/blueprint.ron b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/blueprint.ron deleted file mode 100644 index 1771c5cc8..000000000 --- a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 5, - column: 18, - file: "reflection/crate_resolution/transitive_dependencies_can_be_renamed/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "dep_a0f4586a", - module_path: "dep_a0f4586a", - ), - import_path: "crate::header1", - ), - location: ( - line: 20, - column: 8, - file: "reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "dep_a0f4586a", - module_path: "dep_a0f4586a", - ), - import_path: "crate::header2", - ), - location: ( - line: 21, - column: 8, - file: "reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/handler", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "dep_a0f4586a", - module_path: "dep_a0f4586a", - ), - import_path: "crate::handler", - ), - location: ( - line: 22, - column: 8, - file: "reflection/crate_resolution/transitive_dependencies_can_be_renamed/ephemeral_deps/dep/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/src/lib.rs b/libs/ui_tests/reflection/crate_resolution/transitive_dependencies_can_be_renamed/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml deleted file mode 100644 index f5451352f..000000000 --- a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_603d81dd" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/blueprint.ron deleted file mode 100644 index ed034b206..000000000 --- a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 15, - column: 18, - file: "reflection/generic_handlers_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_603d81dd", - module_path: "app_603d81dd", - ), - import_path: "crate::path", - ), - location: ( - line: 16, - column: 8, - file: "reflection/generic_handlers_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_603d81dd", - module_path: "app_603d81dd", - ), - import_path: "crate::stream_file::", - ), - location: ( - line: 17, - column: 8, - file: "reflection/generic_handlers_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/generic_handlers_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml deleted file mode 100644 index bb444ad20..000000000 --- a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_dcb9931d" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/blueprint.ron b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/blueprint.ron deleted file mode 100644 index 709876e13..000000000 --- a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/blueprint.ron +++ /dev/null @@ -1,30 +0,0 @@ -( - creation_location: ( - line: 8, - column: 18, - file: "reflection/generic_parameters_can_come_from_another_crate/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_dcb9931d", - module_path: "app_dcb9931d", - ), - import_path: "crate::handler", - ), - location: ( - line: 9, - column: 8, - file: "reflection/generic_parameters_can_come_from_another_crate/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/src/lib.rs b/libs/ui_tests/reflection/generic_parameters_can_come_from_another_crate/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/invalid_callable_path/generated_app/Cargo.toml b/libs/ui_tests/reflection/invalid_callable_path/generated_app/Cargo.toml deleted file mode 100644 index 27146d28d..000000000 --- a/libs/ui_tests/reflection/invalid_callable_path/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_05806dea" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/invalid_callable_path/generated_app/blueprint.ron b/libs/ui_tests/reflection/invalid_callable_path/generated_app/blueprint.ron deleted file mode 100644 index 0f2509b39..000000000 --- a/libs/ui_tests/reflection/invalid_callable_path/generated_app/blueprint.ron +++ /dev/null @@ -1,30 +0,0 @@ -( - creation_location: ( - line: 6, - column: 18, - file: "reflection/invalid_callable_path/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "POST", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app", - module_path: "app", - ), - import_path: "my_f,", - ), - location: ( - line: 13, - column: 8, - file: "reflection/invalid_callable_path/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/invalid_callable_path/generated_app/src/lib.rs b/libs/ui_tests/reflection/invalid_callable_path/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml deleted file mode 100644 index a7dc7ef1f..000000000 --- a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_d56c0f9d" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/blueprint.ron b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/blueprint.ron deleted file mode 100644 index a4876139a..000000000 --- a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/blueprint.ron +++ /dev/null @@ -1,47 +0,0 @@ -( - creation_location: ( - line: 19, - column: 18, - file: "reflection/lifetime_restrictions_are_handled/src/lib.rs", - ), - components: [ - WrappingMiddleware(( - middleware: ( - callable: ( - registered_at: ( - crate_name: "app_d56c0f9d", - module_path: "app_d56c0f9d", - ), - import_path: "crate::mw", - ), - location: ( - line: 20, - column: 8, - file: "reflection/lifetime_restrictions_are_handled/src/lib.rs", - ), - ), - error_handler: None, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_d56c0f9d", - module_path: "app_d56c0f9d", - ), - import_path: "crate::handler", - ), - location: ( - line: 21, - column: 8, - file: "reflection/lifetime_restrictions_are_handled/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/src/lib.rs b/libs/ui_tests/reflection/lifetime_restrictions_are_handled/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/Cargo.toml b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/Cargo.toml deleted file mode 100644 index 59ecf3ae6..000000000 --- a/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_33cee83d" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/blueprint.ron b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/blueprint.ron deleted file mode 100644 index e2e2bef6c..000000000 --- a/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/blueprint.ron +++ /dev/null @@ -1,30 +0,0 @@ -( - creation_location: ( - line: 9, - column: 18, - file: "reflection/local_callable_paths_must_be_prefixed_with_crate/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_33cee83d", - module_path: "app_33cee83d", - ), - import_path: "handler", - ), - location: ( - line: 10, - column: 8, - file: "reflection/local_callable_paths_must_be_prefixed_with_crate/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/src/lib.rs b/libs/ui_tests/reflection/local_callable_paths_must_be_prefixed_with_crate/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml deleted file mode 100644 index edee226da..000000000 --- a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_e6a3fe43" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/blueprint.ron deleted file mode 100644 index ec4c57eae..000000000 --- a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,30 +0,0 @@ -( - creation_location: ( - line: 5, - column: 18, - file: "reflection/local_glob_reexports_are_supported/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_e6a3fe43", - module_path: "app_e6a3fe43", - ), - import_path: "crate::nested::function", - ), - location: ( - line: 6, - column: 8, - file: "reflection/local_glob_reexports_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/local_glob_reexports_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml deleted file mode 100644 index e3f1cd4bb..000000000 --- a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_40e90d31" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/blueprint.ron deleted file mode 100644 index 156697a93..000000000 --- a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,90 +0,0 @@ -( - creation_location: ( - line: 32, - column: 18, - file: "reflection/non_static_methods_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_40e90d31", - module_path: "app_40e90d31", - ), - import_path: "crate::Streamer::new", - ), - location: ( - line: 33, - column: 8, - file: "reflection/non_static_methods_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_40e90d31", - module_path: "app_40e90d31", - ), - import_path: "crate::LoggerFactory::new", - ), - location: ( - line: 34, - column: 8, - file: "reflection/non_static_methods_are_supported/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_40e90d31", - module_path: "app_40e90d31", - ), - import_path: "crate::LoggerFactory::logger", - ), - location: ( - line: 35, - column: 8, - file: "reflection/non_static_methods_are_supported/src/lib.rs", - ), - ), - lifecycle: Transient, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_40e90d31", - module_path: "app_40e90d31", - ), - import_path: "crate::Streamer::stream_file", - ), - location: ( - line: 36, - column: 8, - file: "reflection/non_static_methods_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/non_static_methods_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/Cargo.toml b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/Cargo.toml deleted file mode 100644 index 7fe3d8587..000000000 --- a/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_e5e761b9" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/blueprint.ron b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/blueprint.ron deleted file mode 100644 index 8b58349fc..000000000 --- a/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/blueprint.ron +++ /dev/null @@ -1,30 +0,0 @@ -( - creation_location: ( - line: 9, - column: 18, - file: "reflection/output_parameter_cannot_be_handled/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_e5e761b9", - module_path: "app_e5e761b9", - ), - import_path: "crate::c", - ), - location: ( - line: 10, - column: 8, - file: "reflection/output_parameter_cannot_be_handled/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/src/lib.rs b/libs/ui_tests/reflection/output_parameter_cannot_be_handled/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml deleted file mode 100644 index 1342b937f..000000000 --- a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_d1b695a6" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/blueprint.ron deleted file mode 100644 index 0e0d34075..000000000 --- a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 19, - column: 18, - file: "reflection/pattern_bindings_in_input_parameters_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d1b695a6", - module_path: "app_d1b695a6", - ), - import_path: "crate::streamer", - ), - location: ( - line: 20, - column: 8, - file: "reflection/pattern_bindings_in_input_parameters_are_supported/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_d1b695a6", - module_path: "app_d1b695a6", - ), - import_path: "crate::stream_file", - ), - location: ( - line: 21, - column: 8, - file: "reflection/pattern_bindings_in_input_parameters_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/pattern_bindings_in_input_parameters_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml deleted file mode 100644 index 8ac477f37..000000000 --- a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_065fd341" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/blueprint.ron b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/blueprint.ron deleted file mode 100644 index 6a94d75f0..000000000 --- a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 16, - column: 18, - file: "reflection/reexported_type_alias_work/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_065fd341", - module_path: "app_065fd341", - ), - import_path: "crate::constructor", - ), - location: ( - line: 17, - column: 8, - file: "reflection/reexported_type_alias_work/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_065fd341", - module_path: "app_065fd341", - ), - import_path: "crate::handler", - ), - location: ( - line: 18, - column: 8, - file: "reflection/reexported_type_alias_work/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/src/lib.rs b/libs/ui_tests/reflection/reexported_type_alias_work/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml deleted file mode 100644 index 7a8f1574d..000000000 --- a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_698936eb" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/blueprint.ron deleted file mode 100644 index 8d6f9edcc..000000000 --- a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 9, - column: 18, - file: "reflection/relative_paths_prefixed_with_self_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_698936eb", - module_path: "app_698936eb::my_mod", - ), - import_path: "self::A::::new", - ), - location: ( - line: 20, - column: 12, - file: "reflection/relative_paths_prefixed_with_self_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_698936eb", - module_path: "app_698936eb", - ), - import_path: "self::handler", - ), - location: ( - line: 11, - column: 8, - file: "reflection/relative_paths_prefixed_with_self_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_self_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml deleted file mode 100644 index 030250b39..000000000 --- a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ec0f16d1" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/blueprint.ron deleted file mode 100644 index 17fb274e4..000000000 --- a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 17, - column: 18, - file: "reflection/relative_paths_prefixed_with_super_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ec0f16d1", - module_path: "app_ec0f16d1::my_mod", - ), - import_path: "super::A::::new", - ), - location: ( - line: 27, - column: 12, - file: "reflection/relative_paths_prefixed_with_super_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ec0f16d1", - module_path: "app_ec0f16d1::my_mod", - ), - import_path: "super::handler", - ), - location: ( - line: 28, - column: 12, - file: "reflection/relative_paths_prefixed_with_super_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/relative_paths_prefixed_with_super_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml deleted file mode 100644 index bf4eedc7f..000000000 --- a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_d89d2d61" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/blueprint.ron deleted file mode 100644 index 1bfdbe0c8..000000000 --- a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,63 +0,0 @@ -( - creation_location: ( - line: 23, - column: 18, - file: "reflection/self_as_generic_parameter_is_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_d89d2d61", - module_path: "app_d89d2d61", - ), - import_path: "crate::A::new", - ), - location: ( - line: 24, - column: 8, - file: "reflection/self_as_generic_parameter_is_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: Some(( - callable: ( - registered_at: ( - crate_name: "app_d89d2d61", - module_path: "app_d89d2d61", - ), - import_path: "crate::error_handler", - ), - location: ( - line: 25, - column: 10, - file: "reflection/self_as_generic_parameter_is_supported/src/lib.rs", - ), - )), - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_d89d2d61", - module_path: "app_d89d2d61", - ), - import_path: "crate::handler", - ), - location: ( - line: 26, - column: 8, - file: "reflection/self_as_generic_parameter_is_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/self_as_generic_parameter_is_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml deleted file mode 100644 index cbe5a1cbc..000000000 --- a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_d50c6d0c" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/blueprint.ron deleted file mode 100644 index 9b72eddb8..000000000 --- a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,30 +0,0 @@ -( - creation_location: ( - line: 13, - column: 18, - file: "reflection/static_methods_are_supported/src/lib.rs", - ), - components: [ - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_d50c6d0c", - module_path: "app_d50c6d0c", - ), - import_path: "crate::Streamer::stream_file", - ), - location: ( - line: 14, - column: 8, - file: "reflection/static_methods_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/static_methods_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/static_methods_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/Cargo.toml b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/Cargo.toml deleted file mode 100644 index 5aff974d7..000000000 --- a/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_9adade88" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/blueprint.ron b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/blueprint.ron deleted file mode 100644 index fcd455a77..000000000 --- a/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 15, - column: 18, - file: "reflection/the_path_for_generic_arguments_must_be_absolute/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_9adade88", - module_path: "app_9adade88", - ), - import_path: "crate::new_logger::", - ), - location: ( - line: 16, - column: 8, - file: "reflection/the_path_for_generic_arguments_must_be_absolute/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_9adade88", - module_path: "app_9adade88", - ), - import_path: "crate::handler::", - ), - location: ( - line: 17, - column: 8, - file: "reflection/the_path_for_generic_arguments_must_be_absolute/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/src/lib.rs b/libs/ui_tests/reflection/the_path_for_generic_arguments_must_be_absolute/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml deleted file mode 100644 index ac781d582..000000000 --- a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_a7fd6a2c" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/blueprint.ron deleted file mode 100644 index 818fb77de..000000000 --- a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,130 +0,0 @@ -( - creation_location: ( - line: 57, - column: 18, - file: "reflection/trait_methods_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_a7fd6a2c", - module_path: "app_a7fd6a2c", - ), - import_path: "::a_method_that_returns_self", - ), - location: ( - line: 58, - column: 8, - file: "reflection/trait_methods_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_a7fd6a2c", - module_path: "app_a7fd6a2c", - ), - import_path: "::a_method_that_borrows_self", - ), - location: ( - line: 62, - column: 8, - file: "reflection/trait_methods_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_a7fd6a2c", - module_path: "app_a7fd6a2c", - ), - import_path: "::a_method_with_a_generic::", - ), - location: ( - line: 66, - column: 8, - file: "reflection/trait_methods_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_a7fd6a2c", - module_path: "app_a7fd6a2c", - ), - import_path: "::a_method_that_consumes_self", - ), - location: ( - line: 70, - column: 8, - file: "reflection/trait_methods_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_a7fd6a2c", - module_path: "app_a7fd6a2c", - ), - import_path: ">::a_method", - ), - location: ( - line: 74, - column: 8, - file: "reflection/trait_methods_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_a7fd6a2c", - module_path: "app_a7fd6a2c", - ), - import_path: "crate::handler", - ), - location: ( - line: 78, - column: 8, - file: "reflection/trait_methods_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/trait_methods_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml deleted file mode 100644 index d65f947ba..000000000 --- a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_ecefbcb0" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/blueprint.ron deleted file mode 100644 index addb24549..000000000 --- a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 27, - column: 18, - file: "reflection/trait_methods_with_non_local_generics_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ecefbcb0", - module_path: "app_ecefbcb0", - ), - import_path: "crate::b_constructor", - ), - location: ( - line: 28, - column: 8, - file: "reflection/trait_methods_with_non_local_generics_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_ecefbcb0", - module_path: "app_ecefbcb0", - ), - import_path: ">::a_method_using_the_trait_generic_param", - ), - location: ( - line: 29, - column: 8, - file: "reflection/trait_methods_with_non_local_generics_are_supported/src/lib.rs", - ), - ), - lifecycle: RequestScoped, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_ecefbcb0", - module_path: "app_ecefbcb0", - ), - import_path: "crate::handler", - ), - location: ( - line: 33, - column: 8, - file: "reflection/trait_methods_with_non_local_generics_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/trait_methods_with_non_local_generics_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml deleted file mode 100644 index eca443ecd..000000000 --- a/libs/ui_tests/reflection/tuples_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_1bd0738c" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/tuples_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/tuples_are_supported/generated_app/blueprint.ron deleted file mode 100644 index d330abda5..000000000 --- a/libs/ui_tests/reflection/tuples_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,50 +0,0 @@ -( - creation_location: ( - line: 13, - column: 18, - file: "reflection/tuples_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_1bd0738c", - module_path: "app_1bd0738c", - ), - import_path: "crate::constructor_with_output_tuple", - ), - location: ( - line: 14, - column: 8, - file: "reflection/tuples_are_supported/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_1bd0738c", - module_path: "app_1bd0738c", - ), - import_path: "crate::handler_with_input_tuple", - ), - location: ( - line: 18, - column: 8, - file: "reflection/tuples_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/tuples_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/tuples_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml deleted file mode 100644 index adb53a067..000000000 --- a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "application_f8f62968" -version = "0.1.0" -edition = "2021" - -[package.metadata.px.generate] -generator_type = "cargo_workspace_binary" -generator_name = "app" diff --git a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/blueprint.ron b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/blueprint.ron deleted file mode 100644 index 130595f60..000000000 --- a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/blueprint.ron +++ /dev/null @@ -1,70 +0,0 @@ -( - creation_location: ( - line: 19, - column: 18, - file: "reflection/type_alias_are_supported/src/lib.rs", - ), - components: [ - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_f8f62968", - module_path: "app_f8f62968", - ), - import_path: "crate::constructor_with_output_tuple", - ), - location: ( - line: 20, - column: 8, - file: "reflection/type_alias_are_supported/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Constructor(( - constructor: ( - callable: ( - registered_at: ( - crate_name: "app_f8f62968", - module_path: "app_f8f62968", - ), - import_path: "crate::RemoteAlias::new", - ), - location: ( - line: 24, - column: 8, - file: "reflection/type_alias_are_supported/src/lib.rs", - ), - ), - lifecycle: Singleton, - cloning_strategy: None, - error_handler: None, - lints: {}, - )), - Route(( - path: "/home", - method_guard: Some([ - "GET", - ]), - request_handler: ( - callable: ( - registered_at: ( - crate_name: "app_f8f62968", - module_path: "app_f8f62968", - ), - import_path: "crate::handler_with_input_tuple", - ), - location: ( - line: 25, - column: 8, - file: "reflection/type_alias_are_supported/src/lib.rs", - ), - ), - error_handler: None, - )), - ], -) \ No newline at end of file diff --git a/libs/ui_tests/reflection/type_alias_are_supported/generated_app/src/lib.rs b/libs/ui_tests/reflection/type_alias_are_supported/generated_app/src/lib.rs deleted file mode 100644 index e69de29bb..000000000 From 07a0248ef077fc25a40271cdbcd93097c508bd66 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:18:06 +0200 Subject: [PATCH 13/16] Update workspace hack --- libs/Cargo.lock | 3 --- libs/px_workspace_hack/Cargo.toml | 6 ------ 2 files changed, 9 deletions(-) diff --git a/libs/Cargo.lock b/libs/Cargo.lock index 183d606ee..dc401cc52 100644 --- a/libs/Cargo.lock +++ b/libs/Cargo.lock @@ -2648,13 +2648,11 @@ version = "0.1.0" dependencies = [ "ahash", "aho-corasick", - "bitflags 2.6.0", "byteorder", "cc", "clap", "clap_builder", "console", - "crossbeam-utils", "crypto-common", "deranged", "digest", @@ -2693,7 +2691,6 @@ dependencies = [ "tracing-core", "tracing-log", "uuid", - "zerocopy", "zeroize", ] diff --git a/libs/px_workspace_hack/Cargo.toml b/libs/px_workspace_hack/Cargo.toml index 66f3b24e3..cb01d2b3d 100644 --- a/libs/px_workspace_hack/Cargo.toml +++ b/libs/px_workspace_hack/Cargo.toml @@ -19,12 +19,10 @@ license.workspace = true [dependencies] ahash = { version = "0.8" } aho-corasick = { version = "1" } -bitflags = { version = "2", default-features = false, features = ["serde"] } byteorder = { version = "1" } clap = { version = "4", features = ["derive", "env"] } clap_builder = { version = "4", default-features = false, features = ["color", "env", "help", "std", "suggestions", "usage"] } console = { version = "0.15" } -crossbeam-utils = { version = "0.8" } crypto-common = { version = "0.1", default-features = false, features = ["getrandom", "std"] } deranged = { version = "0.3", default-features = false, features = ["powerfmt", "serde", "std"] } digest = { version = "0.10", features = ["mac", "std"] } @@ -62,19 +60,16 @@ tracing = { version = "0.1" } tracing-core = { version = "0.1" } tracing-log = { version = "0.2" } uuid = { version = "1", features = ["fast-rng", "serde", "v4", "v7"] } -zerocopy = { version = "0.7", features = ["derive", "simd"] } zeroize = { version = "1", features = ["zeroize_derive"] } [build-dependencies] ahash = { version = "0.8" } aho-corasick = { version = "1" } -bitflags = { version = "2", default-features = false, features = ["serde"] } byteorder = { version = "1" } cc = { version = "1", default-features = false, features = ["parallel"] } clap = { version = "4", features = ["derive", "env"] } clap_builder = { version = "4", default-features = false, features = ["color", "env", "help", "std", "suggestions", "usage"] } console = { version = "0.15" } -crossbeam-utils = { version = "0.8" } crypto-common = { version = "0.1", default-features = false, features = ["getrandom", "std"] } deranged = { version = "0.3", default-features = false, features = ["powerfmt", "serde", "std"] } digest = { version = "0.10", features = ["mac", "std"] } @@ -113,7 +108,6 @@ tracing = { version = "0.1" } tracing-core = { version = "0.1" } tracing-log = { version = "0.2" } uuid = { version = "1", features = ["fast-rng", "serde", "v4", "v7"] } -zerocopy = { version = "0.7", features = ["derive", "simd"] } zeroize = { version = "1", features = ["zeroize_derive"] } ### END HAKARI SECTION From b1c4567ea9c6df9134f8917b5e6bdd6fc26de9f8 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:00:13 +0200 Subject: [PATCH 14/16] Don't run trybuild tests on Windows --- libs/pavex_macros/tests/fail.rs | 4 ++++ libs/pavex_macros/tests/happy.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/libs/pavex_macros/tests/fail.rs b/libs/pavex_macros/tests/fail.rs index 007184673..bc2d6f0b0 100644 --- a/libs/pavex_macros/tests/fail.rs +++ b/libs/pavex_macros/tests/fail.rs @@ -1,3 +1,7 @@ +// `trybuild` tests are incredibly slow to compile on Windows, so we skip them +// to avoid slowing down the CI pipeline. They still run on Linux and macOS, +// and the outcome is not really platform-dependent. +#[cfg(not(target_os = "windows"))] #[test] fn fail() { let t = trybuild::TestCases::new(); diff --git a/libs/pavex_macros/tests/happy.rs b/libs/pavex_macros/tests/happy.rs index 0ac08b64b..4d5d855f4 100644 --- a/libs/pavex_macros/tests/happy.rs +++ b/libs/pavex_macros/tests/happy.rs @@ -1,3 +1,7 @@ +// `trybuild` tests are incredibly slow to compile on Windows, so we skip them +// to avoid slowing down the CI pipeline. They still run on Linux and macOS, +// and the outcome is not really platform-dependent. +#[cfg(not(target_os = "windows"))] #[test] fn pass() { let t = trybuild::TestCases::new(); From ad9832a4b44591270163adbe6ce2c64c152837ea Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:01:03 +0200 Subject: [PATCH 15/16] Don't look at Cargo.lock --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 105434b4d..ade32d447 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /libs/ui_tests/target /libs/ui_tests/**/generated_app/ -/libs/ui_tests/**/blueprint.ron +/libs/ui_tests/Cargo.lock /libs/target /libs/vendor /doc_examples/tutorial_envs/ From 0bef47b395d3598dfd3577601a2b31c3f451c141 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:01:09 +0200 Subject: [PATCH 16/16] Remove ignored files --- libs/ui_tests/Cargo.lock | 4790 -------------------------------------- 1 file changed, 4790 deletions(-) delete mode 100644 libs/ui_tests/Cargo.lock diff --git a/libs/ui_tests/Cargo.lock b/libs/ui_tests/Cargo.lock deleted file mode 100644 index 2b1d09464..000000000 --- a/libs/ui_tests/Cargo.lock +++ /dev/null @@ -1,4790 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - -[[package]] -name = "aead" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" -dependencies = [ - "crypto-common", - "generic-array", -] - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "aes-gcm-siv" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae0784134ba9375416d469ec31e7c5f9fa94405049cf08c5ce5b4698be673e0d" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "polyval", - "subtle", - "zeroize", -] - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "getrandom", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anstream" -version = "0.6.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" - -[[package]] -name = "anstyle-parse" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - -[[package]] -name = "anyhow" -version = "1.0.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" - -[[package]] -name = "app_00ed62be" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_01492b3d" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_01bbcc3d" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_028e5d85" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_05806dea" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_065fd341" -version = "0.1.0" -dependencies = [ - "dep_065fd341", - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_0ca8edfa" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_0cb36ccc" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_11354b55" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_18d45c43" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_1bd0738c" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_23e2eec5" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_24452d94" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_2480aa2b" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_24d12820" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_2546f91e" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_30248169" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_309371bf" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_335ca652" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_33cee83d" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_366b29bf" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_381916a7" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_39415e2f" -version = "0.1.0" -dependencies = [ - "dep_39415e2f", - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_3acfbc8e" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_3e2693d0" -version = "0.1.0" -dependencies = [ - "dep_3e2693d0", - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_3e90eeee" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_3fac62e4" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_40a0f751" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_40ab089d" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_40e90d31" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_41064ffa" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_466ed127" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_46ab7f5d" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_46e3d1f1" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_4a62f10c" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_4b6f5359" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_4bcfa44d" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_4c9069e8" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_51ea2925" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_53427e7d" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_53b2f5d8" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "serde", - "workspace_hack", -] - -[[package]] -name = "app_55dca802" -version = "0.1.0" -dependencies = [ - "dep_55dca802", - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_56692d2c" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_56967fe8" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_59d05850" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_5f6d02ba" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_603d81dd" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_621e9d53" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_67306117" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_698936eb" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_6b4ffaf2" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_6c44cec0" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_6e40e01f" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_700defb2" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_7321b637" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_7479eeb2" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_74f21254" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_75542b02" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_776ff188" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_78452ff2" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_7c78acb2" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_802eb683" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_812a13f2" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_821d919e" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_835fd2b1" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_88bca0dc" -version = "0.1.0" -dependencies = [ - "bytes 1.7.2", - "http 1.1.0", - "http-body 1.0.1", - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_8ac65a81" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_8b5f0867" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_8b77b4be" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_8ce66b53" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_8e8ba674" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_8ee91948" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_900c9672" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_90734139" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_91e1ac20" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_933292bd" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_951b7f8d" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_9717f587" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_9adade88" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_9b6ffdef" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_9d0a5748" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_9fbe7a0c" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_a0da5eb4" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_a0f4586a" -version = "0.1.0" -dependencies = [ - "dep_a0f4586a", - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_a1f930e1" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_a442c90a" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_a6a2e116" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_a7783cd8" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_a7fd6a2c" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ae32f1c9" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_af31d59e" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_b02b0728" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_b3516518" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ba0e5d33" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_c1ac8ad4" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "serde", - "workspace_hack", -] - -[[package]] -name = "app_c266691d" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_c2e83ed5" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_c3c254cf" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_c51a0844" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "serde", - "workspace_hack", -] - -[[package]] -name = "app_c5885cdb" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_c62eca9e" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_c7a5ef25" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_c8000fe9" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ca08c5dd" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ca963e92" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "reqwest 0.11.27", - "workspace_hack", -] - -[[package]] -name = "app_cb7427d1" -version = "0.1.0" -dependencies = [ - "http 0.1.21", - "http 0.2.12", - "hyper 0.14.30", - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ce0a2170" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_d0f81bc0" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_d1b695a6" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_d238c5d8" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_d24e80c4" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_d2e8db7a" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_d408236b" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_d50c6d0c" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_d56c0f9d" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_d89d2d61" -version = "0.1.0" -dependencies = [ - "anyhow", - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_db1cbdff" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_dc1710a5" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_dcb9931d" -version = "0.1.0" -dependencies = [ - "bytes 1.7.2", - "dep_dcb9931d", - "hyper 1.4.1", - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ddc3d7f1" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_de592621" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_e1c9a48c" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_e31b3bf3" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_e4a8214b" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_e501823b" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "thiserror", - "workspace_hack", -] - -[[package]] -name = "app_e5e761b9" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_e628417e" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "tokio", - "workspace_hack", -] - -[[package]] -name = "app_e6a3fe43" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_e8f51606" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ea86e18a" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ea979460" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ebc534c7" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ec0f16d1" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ecefbcb0" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_ee506b88" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_f10df8fa" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_f1383503" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_f6a54ba5" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_f8f62968" -version = "0.1.0" -dependencies = [ - "dep_f8f62968", - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "app_fc852cc3" -version = "0.1.0" -dependencies = [ - "pavex", - "pavex_cli_client", - "workspace_hack", -] - -[[package]] -name = "application_00ed62be" -version = "0.1.0" - -[[package]] -name = "application_01492b3d" -version = "0.1.0" - -[[package]] -name = "application_01bbcc3d" -version = "0.1.0" - -[[package]] -name = "application_028e5d85" -version = "0.1.0" - -[[package]] -name = "application_05806dea" -version = "0.1.0" - -[[package]] -name = "application_065fd341" -version = "0.1.0" - -[[package]] -name = "application_0ca8edfa" -version = "0.1.0" - -[[package]] -name = "application_0cb36ccc" -version = "0.1.0" - -[[package]] -name = "application_11354b55" -version = "0.1.0" - -[[package]] -name = "application_18d45c43" -version = "0.1.0" - -[[package]] -name = "application_1bd0738c" -version = "0.1.0" - -[[package]] -name = "application_23e2eec5" -version = "0.1.0" - -[[package]] -name = "application_24452d94" -version = "0.1.0" - -[[package]] -name = "application_2480aa2b" -version = "0.1.0" - -[[package]] -name = "application_24d12820" -version = "0.1.0" - -[[package]] -name = "application_2546f91e" -version = "0.1.0" - -[[package]] -name = "application_30248169" -version = "0.1.0" - -[[package]] -name = "application_309371bf" -version = "0.1.0" - -[[package]] -name = "application_335ca652" -version = "0.1.0" - -[[package]] -name = "application_33cee83d" -version = "0.1.0" - -[[package]] -name = "application_366b29bf" -version = "0.1.0" - -[[package]] -name = "application_381916a7" -version = "0.1.0" - -[[package]] -name = "application_39415e2f" -version = "0.1.0" - -[[package]] -name = "application_3acfbc8e" -version = "0.1.0" - -[[package]] -name = "application_3e2693d0" -version = "0.1.0" - -[[package]] -name = "application_3e90eeee" -version = "0.1.0" - -[[package]] -name = "application_3fac62e4" -version = "0.1.0" - -[[package]] -name = "application_40a0f751" -version = "0.1.0" - -[[package]] -name = "application_40ab089d" -version = "0.1.0" - -[[package]] -name = "application_40e90d31" -version = "0.1.0" - -[[package]] -name = "application_41064ffa" -version = "0.1.0" - -[[package]] -name = "application_466ed127" -version = "0.1.0" - -[[package]] -name = "application_46ab7f5d" -version = "0.1.0" - -[[package]] -name = "application_46e3d1f1" -version = "0.1.0" - -[[package]] -name = "application_4a62f10c" -version = "0.1.0" - -[[package]] -name = "application_4b6f5359" -version = "0.1.0" - -[[package]] -name = "application_4bcfa44d" -version = "0.1.0" - -[[package]] -name = "application_4c9069e8" -version = "0.1.0" - -[[package]] -name = "application_51ea2925" -version = "0.1.0" - -[[package]] -name = "application_53427e7d" -version = "0.1.0" - -[[package]] -name = "application_53b2f5d8" -version = "0.1.0" - -[[package]] -name = "application_55dca802" -version = "0.1.0" - -[[package]] -name = "application_56692d2c" -version = "0.1.0" - -[[package]] -name = "application_56967fe8" -version = "0.1.0" - -[[package]] -name = "application_59d05850" -version = "0.1.0" - -[[package]] -name = "application_5f6d02ba" -version = "0.1.0" - -[[package]] -name = "application_603d81dd" -version = "0.1.0" - -[[package]] -name = "application_621e9d53" -version = "0.1.0" - -[[package]] -name = "application_67306117" -version = "0.1.0" - -[[package]] -name = "application_698936eb" -version = "0.1.0" - -[[package]] -name = "application_6b4ffaf2" -version = "0.1.0" - -[[package]] -name = "application_6c44cec0" -version = "0.1.0" - -[[package]] -name = "application_6e40e01f" -version = "0.1.0" - -[[package]] -name = "application_700defb2" -version = "0.1.0" - -[[package]] -name = "application_7321b637" -version = "0.1.0" - -[[package]] -name = "application_7479eeb2" -version = "0.1.0" - -[[package]] -name = "application_74f21254" -version = "0.1.0" - -[[package]] -name = "application_75542b02" -version = "0.1.0" - -[[package]] -name = "application_776ff188" -version = "0.1.0" - -[[package]] -name = "application_78452ff2" -version = "0.1.0" - -[[package]] -name = "application_7c78acb2" -version = "0.1.0" - -[[package]] -name = "application_802eb683" -version = "0.1.0" - -[[package]] -name = "application_812a13f2" -version = "0.1.0" - -[[package]] -name = "application_821d919e" -version = "0.1.0" - -[[package]] -name = "application_835fd2b1" -version = "0.1.0" - -[[package]] -name = "application_88bca0dc" -version = "0.1.0" - -[[package]] -name = "application_8ac65a81" -version = "0.1.0" - -[[package]] -name = "application_8b5f0867" -version = "0.1.0" - -[[package]] -name = "application_8b77b4be" -version = "0.1.0" - -[[package]] -name = "application_8ce66b53" -version = "0.1.0" - -[[package]] -name = "application_8e8ba674" -version = "0.1.0" - -[[package]] -name = "application_8ee91948" -version = "0.1.0" - -[[package]] -name = "application_900c9672" -version = "0.1.0" - -[[package]] -name = "application_90734139" -version = "0.1.0" - -[[package]] -name = "application_91e1ac20" -version = "0.1.0" - -[[package]] -name = "application_933292bd" -version = "0.1.0" - -[[package]] -name = "application_951b7f8d" -version = "0.1.0" - -[[package]] -name = "application_9717f587" -version = "0.1.0" - -[[package]] -name = "application_9adade88" -version = "0.1.0" - -[[package]] -name = "application_9b6ffdef" -version = "0.1.0" - -[[package]] -name = "application_9d0a5748" -version = "0.1.0" - -[[package]] -name = "application_9fbe7a0c" -version = "0.1.0" - -[[package]] -name = "application_a0da5eb4" -version = "0.1.0" - -[[package]] -name = "application_a0f4586a" -version = "0.1.0" - -[[package]] -name = "application_a1f930e1" -version = "0.1.0" - -[[package]] -name = "application_a442c90a" -version = "0.1.0" - -[[package]] -name = "application_a6a2e116" -version = "0.1.0" - -[[package]] -name = "application_a7783cd8" -version = "0.1.0" - -[[package]] -name = "application_a7fd6a2c" -version = "0.1.0" - -[[package]] -name = "application_ae32f1c9" -version = "0.1.0" - -[[package]] -name = "application_af31d59e" -version = "0.1.0" - -[[package]] -name = "application_b02b0728" -version = "0.1.0" - -[[package]] -name = "application_b3516518" -version = "0.1.0" - -[[package]] -name = "application_ba0e5d33" -version = "0.1.0" - -[[package]] -name = "application_c1ac8ad4" -version = "0.1.0" - -[[package]] -name = "application_c266691d" -version = "0.1.0" - -[[package]] -name = "application_c2e83ed5" -version = "0.1.0" - -[[package]] -name = "application_c3c254cf" -version = "0.1.0" - -[[package]] -name = "application_c51a0844" -version = "0.1.0" - -[[package]] -name = "application_c5885cdb" -version = "0.1.0" - -[[package]] -name = "application_c62eca9e" -version = "0.1.0" - -[[package]] -name = "application_c7a5ef25" -version = "0.1.0" - -[[package]] -name = "application_c8000fe9" -version = "0.1.0" - -[[package]] -name = "application_ca08c5dd" -version = "0.1.0" - -[[package]] -name = "application_ca963e92" -version = "0.1.0" - -[[package]] -name = "application_cb7427d1" -version = "0.1.0" - -[[package]] -name = "application_ce0a2170" -version = "0.1.0" - -[[package]] -name = "application_d0f81bc0" -version = "0.1.0" - -[[package]] -name = "application_d1b695a6" -version = "0.1.0" - -[[package]] -name = "application_d238c5d8" -version = "0.1.0" - -[[package]] -name = "application_d24e80c4" -version = "0.1.0" - -[[package]] -name = "application_d2e8db7a" -version = "0.1.0" - -[[package]] -name = "application_d408236b" -version = "0.1.0" - -[[package]] -name = "application_d50c6d0c" -version = "0.1.0" - -[[package]] -name = "application_d56c0f9d" -version = "0.1.0" - -[[package]] -name = "application_d89d2d61" -version = "0.1.0" - -[[package]] -name = "application_db1cbdff" -version = "0.1.0" - -[[package]] -name = "application_dc1710a5" -version = "0.1.0" - -[[package]] -name = "application_dcb9931d" -version = "0.1.0" - -[[package]] -name = "application_ddc3d7f1" -version = "0.1.0" - -[[package]] -name = "application_de592621" -version = "0.1.0" - -[[package]] -name = "application_e1c9a48c" -version = "0.1.0" - -[[package]] -name = "application_e31b3bf3" -version = "0.1.0" - -[[package]] -name = "application_e4a8214b" -version = "0.1.0" - -[[package]] -name = "application_e501823b" -version = "0.1.0" - -[[package]] -name = "application_e5e761b9" -version = "0.1.0" - -[[package]] -name = "application_e628417e" -version = "0.1.0" - -[[package]] -name = "application_e6a3fe43" -version = "0.1.0" - -[[package]] -name = "application_e8f51606" -version = "0.1.0" - -[[package]] -name = "application_ea86e18a" -version = "0.1.0" - -[[package]] -name = "application_ea979460" -version = "0.1.0" - -[[package]] -name = "application_ebc534c7" -version = "0.1.0" - -[[package]] -name = "application_ec0f16d1" -version = "0.1.0" - -[[package]] -name = "application_ecefbcb0" -version = "0.1.0" - -[[package]] -name = "application_ee506b88" -version = "0.1.0" - -[[package]] -name = "application_f10df8fa" -version = "0.1.0" - -[[package]] -name = "application_f1383503" -version = "0.1.0" - -[[package]] -name = "application_f6a54ba5" -version = "0.1.0" - -[[package]] -name = "application_f8f62968" -version = "0.1.0" - -[[package]] -name = "application_fc852cc3" -version = "0.1.0" - -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] - -[[package]] -name = "backtrace-ext" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537beee3be4a18fb023b570f80e3ae28003db9167a751266b259926e25539d50" -dependencies = [ - "backtrace", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "biscotti" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0b3298a722061d404d4f0efb3d9dc2d16601649e6032165696e9c7b25f11d41" -dependencies = [ - "aes-gcm-siv", - "anyhow", - "base64 0.22.1", - "hkdf", - "hmac", - "percent-encoding", - "rand", - "serde", - "sha2", - "subtle", - "time", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -dependencies = [ - "serde", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "iovec", -] - -[[package]] -name = "bytes" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" - -[[package]] -name = "cc" -version = "1.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" -dependencies = [ - "jobserver", - "libc", - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "clap" -version = "4.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" - -[[package]] -name = "colorchoice" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" - -[[package]] -name = "console" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "unicode-width", - "windows-sys 0.52.0", -] - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cpufeatures" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "rand_core", - "typenum", -] - -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - -[[package]] -name = "dep_065fd341" -version = "0.1.0" -dependencies = [ - "pavex", -] - -[[package]] -name = "dep_39415e2f" -version = "0.1.0" -dependencies = [ - "pavex", -] - -[[package]] -name = "dep_3e2693d0" -version = "0.1.0" -dependencies = [ - "pavex", -] - -[[package]] -name = "dep_55dca802" -version = "0.1.0" -dependencies = [ - "pavex", -] - -[[package]] -name = "dep_a0f4586a" -version = "0.1.0" -dependencies = [ - "http 0.1.21", - "http 0.2.12", - "hyper 0.14.30", - "pavex", -] - -[[package]] -name = "dep_dcb9931d" -version = "1.0.0" -dependencies = [ - "pavex", -] - -[[package]] -name = "dep_f8f62968" -version = "0.1.0" -dependencies = [ - "pavex", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fs-err" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" -dependencies = [ - "autocfg", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" - -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes 1.7.2", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes 1.7.2", - "fnv", - "futures-core", - "futures-sink", - "http 1.1.0", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "http" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" -dependencies = [ - "bytes 0.4.12", - "fnv", - "itoa 0.4.8", -] - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes 1.7.2", - "fnv", - "itoa 1.0.11", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes 1.7.2", - "fnv", - "itoa 1.0.11", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes 1.7.2", - "http 0.2.12", - "pin-project-lite", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes 1.7.2", - "http 1.1.0", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" -dependencies = [ - "bytes 1.7.2", - "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "0.14.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" -dependencies = [ - "bytes 1.7.2", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa 1.0.11", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" -dependencies = [ - "bytes 1.7.2", - "futures-channel", - "futures-util", - "h2 0.4.6", - "http 1.1.0", - "http-body 1.0.1", - "httparse", - "httpdate", - "itoa 1.0.11", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" -dependencies = [ - "futures-util", - "http 1.1.0", - "hyper 1.4.1", - "hyper-util", - "rustls", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", - "webpki-roots", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes 1.7.2", - "hyper 0.14.30", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes 1.7.2", - "http-body-util", - "hyper 1.4.1", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" -dependencies = [ - "bytes 1.7.2", - "futures-channel", - "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "hyper 1.4.1", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", -] - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - -[[package]] -name = "integration_56967fe8" -version = "0.1.0" -dependencies = [ - "app_56967fe8", - "application_56967fe8", - "http-body-util", - "hyper 1.4.1", - "hyper-util", - "pavex", - "reqwest 0.12.7", - "tokio", - "tracing-subscriber", -] - -[[package]] -name = "integration_78452ff2" -version = "0.1.0" -dependencies = [ - "app_78452ff2", - "application_78452ff2", - "pavex", - "reqwest 0.12.7", - "tokio", - "tracing-subscriber", -] - -[[package]] -name = "integration_a1f930e1" -version = "0.1.0" -dependencies = [ - "app_a1f930e1", - "application_a1f930e1", - "pavex", - "reqwest 0.12.7", - "tokio", - "tracing-subscriber", -] - -[[package]] -name = "integration_c1ac8ad4" -version = "0.1.0" -dependencies = [ - "app_c1ac8ad4", - "application_c1ac8ad4", - "pavex", - "reqwest 0.12.7", - "tokio", - "tracing-subscriber", -] - -[[package]] -name = "integration_e628417e" -version = "0.1.0" -dependencies = [ - "app_e628417e", - "application_e628417e", - "pavex", - "reqwest 0.12.7", - "tokio", - "tracing-subscriber", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - -[[package]] -name = "ipnet" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" - -[[package]] -name = "is_ci" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "jobserver" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.159" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "miette" -version = "7.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" -dependencies = [ - "backtrace", - "backtrace-ext", - "cfg-if", - "miette-derive", - "owo-colors", - "supports-color", - "supports-hyperlinks", - "supports-unicode", - "terminal_size", - "textwrap", - "thiserror", - "unicode-width", -] - -[[package]] -name = "miette-derive" -version = "7.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" -dependencies = [ - "adler2", -] - -[[package]] -name = "mio" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" -dependencies = [ - "hermit-abi", - "libc", - "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_threads" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" -dependencies = [ - "libc", -] - -[[package]] -name = "object" -version = "0.36.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "owo-colors" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pavex" -version = "0.1.48" -dependencies = [ - "anyhow", - "biscotti", - "bytes 1.7.2", - "fs-err", - "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "http-body-util", - "hyper 1.4.1", - "hyper-util", - "indexmap", - "mime", - "paste", - "pavex_bp_schema", - "pavex_macros", - "pavex_matchit", - "pavex_reflection", - "percent-encoding", - "persist_if_changed", - "pin-project-lite", - "px_workspace_hack", - "ron", - "serde", - "serde_html_form", - "serde_json", - "serde_path_to_error", - "smallvec", - "socket2", - "thiserror", - "time", - "tokio", - "tracing", - "type-safe-id", - "ubyte", - "uuid", -] - -[[package]] -name = "pavex_bp_schema" -version = "0.1.48" -dependencies = [ - "pavex_reflection", - "px_workspace_hack", - "serde", -] - -[[package]] -name = "pavex_cli_client" -version = "0.1.48" -dependencies = [ - "anyhow", - "pavex", - "px_workspace_hack", - "thiserror", -] - -[[package]] -name = "pavex_macros" -version = "0.1.48" -dependencies = [ - "proc-macro2", - "px_workspace_hack", - "quote", - "syn", -] - -[[package]] -name = "pavex_matchit" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b9753b03381fd8856966146c4d626d9a8507901c1bcdfbc41df03deea551fc" - -[[package]] -name = "pavex_reflection" -version = "0.1.48" -dependencies = [ - "px_workspace_hack", - "serde", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "persist_if_changed" -version = "0.1.48" -dependencies = [ - "anyhow", - "fs-err", - "px_workspace_hack", - "sha2", - "tracing", -] - -[[package]] -name = "petgraph" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - -[[package]] -name = "polyval" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug", - "universal-hash", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "px_workspace_hack" -version = "0.1.0" -dependencies = [ - "ahash", - "aho-corasick", - "bitflags 2.6.0", - "byteorder", - "cc", - "clap", - "clap_builder", - "console", - "crossbeam-utils", - "crypto-common", - "deranged", - "digest", - "fixedbitset", - "futures-channel", - "futures-core", - "futures-sink", - "futures-util", - "getrandom", - "hashbrown", - "hmac", - "indexmap", - "log", - "memchr", - "miette", - "num-traits", - "petgraph", - "proc-macro2", - "quote", - "regex", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", - "reqwest 0.12.7", - "serde", - "serde_json", - "sha2", - "smallvec", - "subtle", - "syn", - "time", - "time-macros", - "tokio", - "toml", - "toml_edit", - "tracing", - "tracing-core", - "tracing-log", - "uuid", - "zerocopy", - "zeroize", -] - -[[package]] -name = "quinn" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" -dependencies = [ - "bytes 1.7.2", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "socket2", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" -dependencies = [ - "bytes 1.7.2", - "rand", - "ring", - "rustc-hash", - "rustls", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - -[[package]] -name = "quinn-udp" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" -dependencies = [ - "libc", - "once_cell", - "socket2", - "tracing", - "windows-sys 0.59.0", -] - -[[package]] -name = "quote" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "redox_syscall" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62871f2d65009c0256aed1b9cfeeb8ac272833c404e13d53d400cd0dad7a2ac0" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes 1.7.2", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.30", - "hyper-tls 0.5.0", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile 1.0.4", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration 0.5.1", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - -[[package]] -name = "reqwest" -version = "0.12.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" -dependencies = [ - "base64 0.22.1", - "bytes 1.7.2", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.4.6", - "http 1.1.0", - "http-body 1.0.1", - "http-body-util", - "hyper 1.4.1", - "hyper-rustls", - "hyper-tls 0.6.0", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "quinn", - "rustls", - "rustls-pemfile 2.1.3", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 1.0.1", - "system-configuration 0.6.1", - "tokio", - "tokio-native-tls", - "tokio-rustls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots", - "windows-registry", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "ron" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" -dependencies = [ - "base64 0.21.7", - "bitflags 2.6.0", - "serde", - "serde_derive", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "rustix" -version = "0.38.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.23.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" -dependencies = [ - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - -[[package]] -name = "rustls-pemfile" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" -dependencies = [ - "base64 0.22.1", - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" - -[[package]] -name = "rustls-webpki" -version = "0.102.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "schannel" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags 2.6.0", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "serde" -version = "1.0.210" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.210" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_html_form" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de514ef58196f1fc96dcaef80fe6170a1ce6215df9687a93fe8300e773fefc5" -dependencies = [ - "form_urlencoded", - "indexmap", - "itoa 1.0.11", - "ryu", - "serde", -] - -[[package]] -name = "serde_json" -version = "1.0.128" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" -dependencies = [ - "itoa 1.0.11", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" -dependencies = [ - "itoa 1.0.11", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa 1.0.11", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "supports-color" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8775305acf21c96926c900ad056abeef436701108518cf890020387236ac5a77" -dependencies = [ - "is_ci", -] - -[[package]] -name = "supports-hyperlinks" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0a1e5168041f5f3ff68ff7d95dcb9c8749df29f6e7e89ada40dd4c9de404ee" - -[[package]] -name = "supports-unicode" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" - -[[package]] -name = "syn" -version = "2.0.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" -dependencies = [ - "futures-core", -] - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys 0.5.0", -] - -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags 2.6.0", - "core-foundation", - "system-configuration-sys 0.6.0", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - -[[package]] -name = "terminal_size" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" -dependencies = [ - "rustix", - "windows-sys 0.48.0", -] - -[[package]] -name = "textwrap" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" -dependencies = [ - "smawk", - "unicode-linebreak", - "unicode-width", -] - -[[package]] -name = "thiserror" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa 1.0.11", - "libc", - "num-conv", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinyvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" -dependencies = [ - "backtrace", - "bytes 1.7.2", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-macros" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" -dependencies = [ - "rustls", - "rustls-pki-types", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes 1.7.2", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "type-safe-id" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2145079685621738e4e02fef4d5882d64498e8fcc90c8eee8dfcb9e62317ae2" -dependencies = [ - "arrayvec", - "rand", - "thiserror", - "uuid", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "ubyte" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" -dependencies = [ - "serde", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" - -[[package]] -name = "unicode-linebreak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" - -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "universal-hash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" -dependencies = [ - "crypto-common", - "subtle", -] - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "uuid" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" -dependencies = [ - "getrandom", - "rand", - "serde", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" -dependencies = [ - "cfg-if", - "once_cell", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" - -[[package]] -name = "web-sys" -version = "0.3.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.26.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-registry" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" -dependencies = [ - "windows-result", - "windows-strings", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-strings" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" -dependencies = [ - "windows-result", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.6.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c52ac009d615e79296318c1bcce2d422aaca15ad08515e344feeda07df67a587" -dependencies = [ - "memchr", -] - -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "workspace_hack" -version = "0.1.0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-sink", - "futures-task", - "futures-util", - "memchr", - "proc-macro2", - "quote", - "reqwest 0.12.7", - "serde", - "serde_json", - "smallvec", - "syn", - "tokio", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder", - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn", -]