├── README.md
├── axum
├── LICENSE
├── src
│ ├── routing
│ │ ├── future.rs
│ │ ├── not_found.rs
│ │ ├── into_make_service.rs
│ │ └── url_params.rs
│ ├── docs
│ │ ├── handlers_intro.md
│ │ ├── method_routing
│ │ │ ├── merge.md
│ │ │ ├── layer.md
│ │ │ ├── route_layer.md
│ │ │ └── fallback.md
│ │ ├── routing
│ │ │ ├── without_v07_checks.md
│ │ │ ├── method_not_allowed_fallback.md
│ │ │ ├── route_layer.md
│ │ │ └── fallback.md
│ │ └── debugging_handler_type_errors.md
│ ├── test_helpers
│ │ ├── mod.rs
│ │ └── counting_cloneable_state.rs
│ ├── extract
│ │ └── raw_query.rs
│ ├── middleware
│ │ └── mod.rs
│ ├── handler
│ │ └── future.rs
│ └── body
│ │ └── mod.rs
└── tests
│ └── panic_location.rs
├── axum-core
├── LICENSE
├── src
│ ├── error.rs
│ ├── extract
│ │ └── from_ref.rs
│ ├── lib.rs
│ └── ext_traits
│ │ └── mod.rs
├── README.md
└── Cargo.toml
├── axum-extra
├── LICENSE
├── test_files
│ ├── script.js
│ ├── index.html
│ └── index_2.html
├── src
│ ├── body
│ │ └── mod.rs
│ ├── extract
│ │ └── rejection.rs
│ └── response
│ │ └── error_response.rs
└── README.md
├── axum-macros
├── LICENSE
├── tests
│ ├── debug_handler
│ │ ├── fail
│ │ │ ├── .gitkeep
│ │ │ ├── not_a_function.rs
│ │ │ ├── not_async.rs
│ │ │ ├── invalid_attrs.rs
│ │ │ ├── generics.rs
│ │ │ ├── argument_not_extractor.rs
│ │ │ ├── not_a_function.stderr
│ │ │ ├── duplicate_args.rs
│ │ │ ├── not_async.stderr
│ │ │ ├── wrong_return_type.rs
│ │ │ ├── invalid_attrs.stderr
│ │ │ ├── multiple_paths.rs
│ │ │ ├── not_send.rs
│ │ │ ├── json_not_deserialize.rs
│ │ │ ├── duplicate_args.stderr
│ │ │ ├── extract_self_ref.stderr
│ │ │ ├── extract_self_mut.stderr
│ │ │ ├── generics.stderr
│ │ │ ├── single_wrong_return_tuple.rs
│ │ │ ├── extension_not_clone.rs
│ │ │ ├── wrong_order.rs
│ │ │ ├── returning_request_parts.rs
│ │ │ ├── multiple_request_consumers.rs
│ │ │ ├── too_many_extractors.stderr
│ │ │ ├── returning_request_parts.stderr
│ │ │ ├── extract_self_ref.rs
│ │ │ ├── extract_self_mut.rs
│ │ │ ├── output_tuple_too_many.stderr
│ │ │ ├── too_many_extractors.rs
│ │ │ ├── wrong_order.stderr
│ │ │ ├── multiple_request_consumers.stderr
│ │ │ ├── multiple_paths.stderr
│ │ │ ├── wrong_return_tuple.rs
│ │ │ ├── wrong_return_type.stderr
│ │ │ ├── not_send.stderr
│ │ │ ├── single_wrong_return_tuple.stderr
│ │ │ ├── output_tuple_too_many.rs
│ │ │ ├── extension_not_clone.stderr
│ │ │ └── argument_not_extractor.stderr
│ │ └── pass
│ │ │ ├── associated_fn_without_self.rs
│ │ │ ├── ready.rs
│ │ │ ├── deny_unreachable_code.rs
│ │ │ ├── mut_extractor.rs
│ │ │ ├── multiple_extractors.rs
│ │ │ ├── request_last.rs
│ │ │ ├── impl_future.rs
│ │ │ ├── impl_into_response.rs
│ │ │ ├── state_and_body.rs
│ │ │ ├── returns_self.rs
│ │ │ ├── set_state.rs
│ │ │ ├── infer_state.rs
│ │ │ └── self_receiver.rs
│ ├── from_request
│ │ ├── fail
│ │ │ ├── enum_no_via.rs
│ │ │ ├── not_enum_or_struct.rs
│ │ │ ├── generic.rs
│ │ │ ├── unknown_attr_container.rs
│ │ │ ├── unknown_attr_field.rs
│ │ │ ├── unknown_attr_container.stderr
│ │ │ ├── unknown_attr_field.stderr
│ │ │ ├── double_via_attr.rs
│ │ │ ├── enum_from_request_on_variant.stderr
│ │ │ ├── enum_from_request_on_variant.rs
│ │ │ ├── generic.stderr
│ │ │ ├── via_on_container_and_field.rs
│ │ │ ├── enum_from_request_ident_in_variant.stderr
│ │ │ ├── double_via_attr.stderr
│ │ │ ├── generic_without_via.rs
│ │ │ ├── enum_from_request_ident_in_variant.rs
│ │ │ ├── parts_extracting_body.rs
│ │ │ ├── enum_no_via.stderr
│ │ │ ├── generic_without_via_rejection.rs
│ │ │ ├── via_on_container_and_field.stderr
│ │ │ ├── not_enum_or_struct.stderr
│ │ │ ├── state_infer_multiple_different_types.stderr
│ │ │ ├── state_infer_multiple_different_types.rs
│ │ │ ├── override_rejection_on_enum_without_via.rs
│ │ │ ├── parts_extracting_body.stderr
│ │ │ ├── generic_without_via.stderr
│ │ │ └── generic_without_via_rejection.stderr
│ │ └── pass
│ │ │ ├── tuple.rs
│ │ │ ├── unit.rs
│ │ │ ├── empty_named.rs
│ │ │ ├── empty_tuple.rs
│ │ │ ├── unit_parts.rs
│ │ │ ├── tuple_parts.rs
│ │ │ ├── empty_named_parts.rs
│ │ │ ├── empty_tuple_parts.rs
│ │ │ ├── enum_via.rs
│ │ │ ├── enum_via_parts.rs
│ │ │ ├── tuple_via.rs
│ │ │ ├── tuple_via_parts.rs
│ │ │ ├── tuple_same_type_twice.rs
│ │ │ ├── state_infer.rs
│ │ │ ├── state_infer_parts.rs
│ │ │ ├── tuple_same_type_twice_parts.rs
│ │ │ ├── container.rs
│ │ │ ├── state_infer_multiple.rs
│ │ │ ├── container_parts.rs
│ │ │ ├── state_field_infer.rs
│ │ │ ├── state_via_infer.rs
│ │ │ ├── tuple_same_type_twice_via.rs
│ │ │ ├── tuple_same_type_twice_via_parts.rs
│ │ │ ├── state_cookie.rs
│ │ │ ├── named_parts.rs
│ │ │ ├── named.rs
│ │ │ ├── state_via.rs
│ │ │ ├── state_enum_via.rs
│ │ │ ├── state_field_explicit.rs
│ │ │ ├── state_explicit_parts.rs
│ │ │ ├── named_via.rs
│ │ │ ├── override_rejection_with_via_on_enum.rs
│ │ │ ├── state_via_parts.rs
│ │ │ ├── named_via_parts.rs
│ │ │ ├── override_rejection_with_via_on_enum_parts.rs
│ │ │ ├── state_with_rejection.rs
│ │ │ ├── state_enum_via_parts.rs
│ │ │ ├── override_rejection_with_via_on_struct.rs
│ │ │ ├── override_rejection_non_generic.rs
│ │ │ ├── override_rejection_with_via_on_struct_parts.rs
│ │ │ ├── override_rejection_non_generic_parts.rs
│ │ │ ├── state_explicit.rs
│ │ │ ├── override_rejection.rs
│ │ │ └── override_rejection_parts.rs
│ ├── from_ref
│ │ ├── fail
│ │ │ ├── generics.rs
│ │ │ └── generics.stderr
│ │ └── pass
│ │ │ ├── reference-types.rs
│ │ │ ├── skip.rs
│ │ │ └── basic.rs
│ ├── typed_path
│ │ ├── fail
│ │ │ ├── route_not_starting_with_slash.rs
│ │ │ ├── route_not_starting_with_slash_non_empty.rs
│ │ │ ├── not_deserialize.rs
│ │ │ ├── missing_field.rs
│ │ │ ├── unit_with_capture.rs
│ │ │ ├── missing_capture.rs
│ │ │ ├── route_not_starting_with_slash.stderr
│ │ │ ├── unit_with_capture.stderr
│ │ │ ├── route_not_starting_with_slash_non_empty.stderr
│ │ │ ├── missing_field.stderr
│ │ │ └── missing_capture.stderr
│ │ └── pass
│ │ │ ├── wildcards.rs
│ │ │ ├── unit_struct.rs
│ │ │ ├── tuple_struct.rs
│ │ │ ├── into_uri.rs
│ │ │ ├── url_encoding.rs
│ │ │ ├── named_fields_struct.rs
│ │ │ ├── result_handler.rs
│ │ │ └── customize_rejection.rs
│ └── debug_middleware
│ │ ├── pass
│ │ └── basic.rs
│ │ └── fail
│ │ ├── next_not_last.stderr
│ │ ├── next_not_last.rs
│ │ ├── takes_next_twice.rs
│ │ ├── doesnt_take_next.rs
│ │ ├── doesnt_take_next.stderr
│ │ └── takes_next_twice.stderr
├── rust-toolchain
├── src
│ └── axum_test.rs
├── Cargo.toml
└── README.md
├── .gitignore
├── examples
├── sse
│ ├── assets
│ │ ├── index.html
│ │ └── script.js
│ └── Cargo.toml
├── static-file-server
│ ├── assets
│ │ ├── index.html
│ │ └── script.js
│ └── Cargo.toml
├── templates
│ ├── templates
│ │ └── hello.html
│ └── Cargo.toml
├── async-graphql
│ └── README.md
├── compression
│ ├── data
│ │ ├── products.json.gz
│ │ └── products.json
│ ├── Cargo.toml
│ ├── README.md
│ └── src
│ │ └── main.rs
├── diesel-postgres
│ ├── migrations
│ │ └── 2023-03-14-180127_add_users
│ │ │ ├── down.sql
│ │ │ └── up.sql
│ └── Cargo.toml
├── diesel-async-postgres
│ ├── migrations
│ │ └── 2023-03-14-180127_add_users
│ │ │ ├── down.sql
│ │ │ └── up.sql
│ └── Cargo.toml
├── websockets
│ ├── assets
│ │ ├── index.html
│ │ └── script.js
│ └── Cargo.toml
├── templates-minijinja
│ ├── templates
│ │ ├── about.jinja
│ │ ├── home.jinja
│ │ ├── content.jinja
│ │ └── layout.jinja
│ └── Cargo.toml
├── hello-world
│ ├── Cargo.toml
│ └── src
│ │ └── main.rs
├── auto-reload
│ ├── Cargo.toml
│ ├── README.md
│ └── src
│ │ └── main.rs
├── README.md
├── cors
│ └── Cargo.toml
├── routes-and-handlers-close-together
│ ├── Cargo.toml
│ └── src
│ │ └── main.rs
├── websockets-http2
│ ├── assets
│ │ ├── index.html
│ │ └── script.js
│ ├── Cargo.toml
│ └── self_signed_certs
│ │ ├── cert.pem
│ │ └── key.pem
├── global-404-handler
│ ├── Cargo.toml
│ └── src
│ │ └── main.rs
├── tokio-redis
│ └── Cargo.toml
├── reverse-proxy
│ └── Cargo.toml
├── readme
│ ├── Cargo.toml
│ └── src
│ │ └── main.rs
├── print-request-response
│ └── Cargo.toml
├── anyhow-error-response
│ └── Cargo.toml
├── consume-body-in-extractor-or-middleware
│ └── Cargo.toml
├── customize-path-rejection
│ └── Cargo.toml
├── tokio-postgres
│ └── Cargo.toml
├── graceful-shutdown
│ └── Cargo.toml
├── query-params-with-empty-strings
│ └── Cargo.toml
├── handle-head-request
│ └── Cargo.toml
├── request-id
│ └── Cargo.toml
├── testing-websockets
│ └── Cargo.toml
├── chat
│ └── Cargo.toml
├── parse-body-based-on-content-type
│ └── Cargo.toml
├── sqlx-postgres
│ └── Cargo.toml
├── multipart-form
│ └── Cargo.toml
├── serve-with-hyper
│ └── Cargo.toml
├── tracing-aka-logging
│ └── Cargo.toml
├── tls-rustls
│ ├── Cargo.toml
│ └── self_signed_certs
│ │ ├── cert.pem
│ │ └── key.pem
├── versioning
│ └── Cargo.toml
├── tls-graceful-shutdown
│ ├── Cargo.toml
│ └── self_signed_certs
│ │ ├── cert.pem
│ │ └── key.pem
├── http-proxy
│ └── Cargo.toml
├── form
│ └── Cargo.toml
├── error-handling
│ └── Cargo.toml
├── mongodb
│ └── Cargo.toml
├── prometheus-metrics
│ └── Cargo.toml
├── reqwest-response
│ └── Cargo.toml
├── unix-domain-socket
│ └── Cargo.toml
├── dependency-injection
│ └── Cargo.toml
├── low-level-native-tls
│ ├── Cargo.toml
│ └── self_signed_certs
│ │ ├── cert.pem
│ │ └── key.pem
├── low-level-rustls
│ ├── Cargo.toml
│ └── self_signed_certs
│ │ ├── cert.pem
│ │ └── key.pem
├── stream-to-file
│ └── Cargo.toml
├── jwt
│ └── Cargo.toml
├── low-level-openssl
│ ├── Cargo.toml
│ └── self_signed_certs
│ │ ├── cert.pem
│ │ └── key.pem
├── customize-extractor-error
│ ├── Cargo.toml
│ ├── README.md
│ └── src
│ │ └── main.rs
├── todos
│ └── Cargo.toml
├── validator
│ └── Cargo.toml
├── key-value-store
│ └── Cargo.toml
├── testing
│ └── Cargo.toml
├── oauth
│ └── Cargo.toml
└── simple-router-wasm
│ └── Cargo.toml
├── CHANGELOG.md
├── .clippy.toml
├── .github
├── ISSUE_TEMPLATE
│ ├── config.yml
│ ├── feature_request.md
│ └── bug_report.md
├── DISCUSSION_TEMPLATE
│ └── q-a.yml
└── PULL_REQUEST_TEMPLATE.md
├── deny.toml
└── LICENSE
/README.md:
--------------------------------------------------------------------------------
1 | axum/README.md
--------------------------------------------------------------------------------
/axum/LICENSE:
--------------------------------------------------------------------------------
1 | ../LICENSE
--------------------------------------------------------------------------------
/axum-core/LICENSE:
--------------------------------------------------------------------------------
1 | ../LICENSE
--------------------------------------------------------------------------------
/axum-extra/LICENSE:
--------------------------------------------------------------------------------
1 | ../LICENSE
--------------------------------------------------------------------------------
/axum-macros/LICENSE:
--------------------------------------------------------------------------------
1 | ../LICENSE
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | .DS_Store
3 | .vscode
4 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/axum-extra/test_files/script.js:
--------------------------------------------------------------------------------
1 | console.log('hi')
2 |
--------------------------------------------------------------------------------
/axum-macros/rust-toolchain:
--------------------------------------------------------------------------------
1 | nightly-2025-09-28
2 |
--------------------------------------------------------------------------------
/axum-extra/test_files/index.html:
--------------------------------------------------------------------------------
1 |
Hello, World!
2 |
--------------------------------------------------------------------------------
/examples/sse/assets/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/examples/static-file-server/assets/index.html:
--------------------------------------------------------------------------------
1 | Hi from index.html
2 |
--------------------------------------------------------------------------------
/axum-extra/test_files/index_2.html:
--------------------------------------------------------------------------------
1 | Hello, World!
2 |
--------------------------------------------------------------------------------
/examples/templates/templates/hello.html:
--------------------------------------------------------------------------------
1 | Hello, {{ name }}!
2 |
--------------------------------------------------------------------------------
/examples/static-file-server/assets/script.js:
--------------------------------------------------------------------------------
1 | console.log("Hello, World!");
2 |
--------------------------------------------------------------------------------
/examples/async-graphql/README.md:
--------------------------------------------------------------------------------
1 | See .
2 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | axum's changelog has moved and now lives [here](https://github.com/tokio-rs/axum/blob/main/axum/CHANGELOG.md).
2 |
--------------------------------------------------------------------------------
/examples/compression/data/products.json.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sferik/axum/main/examples/compression/data/products.json.gz
--------------------------------------------------------------------------------
/examples/diesel-postgres/migrations/2023-03-14-180127_add_users/down.sql:
--------------------------------------------------------------------------------
1 | -- This file should undo anything in "up.sql"
2 | DROP TABLE "users";
3 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/not_a_function.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 |
3 | #[debug_handler]
4 | struct A;
5 |
6 | fn main() {}
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/not_async.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 |
3 | #[debug_handler]
4 | fn handler() {}
5 |
6 | fn main() {}
7 |
--------------------------------------------------------------------------------
/examples/diesel-async-postgres/migrations/2023-03-14-180127_add_users/down.sql:
--------------------------------------------------------------------------------
1 | -- This file should undo anything in "up.sql"
2 | DROP TABLE "users";
3 |
--------------------------------------------------------------------------------
/examples/websockets/assets/index.html:
--------------------------------------------------------------------------------
1 | Open the console to see stuff, then refresh to initiate exchange.
2 |
3 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/invalid_attrs.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 |
3 | #[debug_handler(foo)]
4 | async fn handler() {}
5 |
6 | fn main() {}
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/from_request/fail/enum_no_via.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::FromRequest;
2 |
3 | #[derive(FromRequest, Clone)]
4 | enum Extractor {}
5 |
6 | fn main() {}
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/from_request/fail/not_enum_or_struct.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::FromRequest;
2 |
3 | #[derive(FromRequest)]
4 | union Extractor {}
5 |
6 | fn main() {}
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/generics.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 |
3 | #[debug_handler]
4 | async fn handler(_extract: T) {}
5 |
6 | fn main() {}
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/from_request/fail/generic.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::FromRequest;
2 |
3 | #[derive(FromRequest)]
4 | struct Extractor(Option);
5 |
6 | fn main() {}
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/argument_not_extractor.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 |
3 | #[debug_handler]
4 | async fn handler(_foo: bool) {}
5 |
6 | fn main() {}
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/not_a_function.stderr:
--------------------------------------------------------------------------------
1 | error: expected `fn`
2 | --> tests/debug_handler/fail/not_a_function.rs:4:1
3 | |
4 | 4 | struct A;
5 | | ^^^^^^
6 |
--------------------------------------------------------------------------------
/axum-macros/tests/from_ref/fail/generics.rs:
--------------------------------------------------------------------------------
1 | use axum::extract::FromRef;
2 |
3 | #[derive(Clone, FromRef)]
4 | struct AppState {
5 | foo: T,
6 | }
7 |
8 | fn main() {}
9 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/duplicate_args.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 |
3 | #[debug_handler(state = (), state = ())]
4 | async fn handler() {}
5 |
6 | fn main() {}
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/not_async.stderr:
--------------------------------------------------------------------------------
1 | error: Handlers must be `async fn`s
2 | --> tests/debug_handler/fail/not_async.rs:4:1
3 | |
4 | 4 | fn handler() {}
5 | | ^^
6 |
--------------------------------------------------------------------------------
/axum/src/routing/future.rs:
--------------------------------------------------------------------------------
1 | //! Future types.
2 |
3 | pub use super::{
4 | into_make_service::IntoMakeServiceFuture,
5 | route::{InfallibleRouteFuture, RouteFuture},
6 | };
7 |
--------------------------------------------------------------------------------
/examples/sse/assets/script.js:
--------------------------------------------------------------------------------
1 | var eventSource = new EventSource('sse');
2 |
3 | eventSource.onmessage = function(event) {
4 | console.log('Message from server ', event.data);
5 | }
6 |
--------------------------------------------------------------------------------
/.clippy.toml:
--------------------------------------------------------------------------------
1 | allow-mixed-uninlined-format-args = false
2 | disallowed-types = [
3 | { path = "tower::util::BoxCloneService", reason = "Use tower::util::BoxCloneSyncService instead" },
4 | ]
5 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/wrong_return_type.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 |
3 | #[debug_handler]
4 | async fn handler() -> bool {
5 | false
6 | }
7 |
8 | fn main() {}
9 |
--------------------------------------------------------------------------------
/axum-macros/tests/from_request/fail/unknown_attr_container.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::FromRequest;
2 |
3 | #[derive(FromRequest)]
4 | #[from_request(foo)]
5 | struct Extractor;
6 |
7 | fn main() {}
8 |
--------------------------------------------------------------------------------
/axum-macros/tests/from_request/fail/unknown_attr_field.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::FromRequest;
2 |
3 | #[derive(FromRequest)]
4 | struct Extractor(#[from_request(foo)] String);
5 |
6 | fn main() {}
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/typed_path/fail/route_not_starting_with_slash.rs:
--------------------------------------------------------------------------------
1 | use axum_extra::routing::TypedPath;
2 |
3 | #[derive(TypedPath)]
4 | #[typed_path("")]
5 | struct MyPath;
6 |
7 | fn main() {}
8 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/invalid_attrs.stderr:
--------------------------------------------------------------------------------
1 | error: expected `state`
2 | --> tests/debug_handler/fail/invalid_attrs.rs:3:17
3 | |
4 | 3 | #[debug_handler(foo)]
5 | | ^^^
6 |
--------------------------------------------------------------------------------
/axum-extra/src/body/mod.rs:
--------------------------------------------------------------------------------
1 | //! Additional bodies.
2 |
3 | #[cfg(feature = "async-read-body")]
4 | mod async_read_body;
5 |
6 | #[cfg(feature = "async-read-body")]
7 | pub use self::async_read_body::AsyncReadBody;
8 |
--------------------------------------------------------------------------------
/axum-macros/tests/from_ref/fail/generics.stderr:
--------------------------------------------------------------------------------
1 | error: `#[derive(FromRef)]` doesn't support generics
2 | --> tests/from_ref/fail/generics.rs:4:16
3 | |
4 | 4 | struct AppState {
5 | | ^^^
6 |
--------------------------------------------------------------------------------
/axum-macros/tests/typed_path/fail/route_not_starting_with_slash_non_empty.rs:
--------------------------------------------------------------------------------
1 | use axum_extra::routing::TypedPath;
2 |
3 | #[derive(TypedPath)]
4 | #[typed_path("{foo}")]
5 | struct MyPath;
6 |
7 | fn main() {}
8 |
--------------------------------------------------------------------------------
/examples/diesel-postgres/migrations/2023-03-14-180127_add_users/up.sql:
--------------------------------------------------------------------------------
1 | -- Your SQL goes here
2 | CREATE TABLE "users"(
3 | "id" SERIAL PRIMARY KEY,
4 | "name" TEXT NOT NULL,
5 | "hair_color" TEXT
6 | );
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/typed_path/fail/not_deserialize.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::TypedPath;
2 |
3 | #[derive(TypedPath)]
4 | #[typed_path("/users/{id}")]
5 | struct MyPath {
6 | id: u32,
7 | }
8 |
9 | fn main() {}
10 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/multiple_paths.rs:
--------------------------------------------------------------------------------
1 | use axum::extract::Path;
2 | use axum_macros::debug_handler;
3 |
4 | #[debug_handler]
5 | async fn handler(_: Path, _: Path) {}
6 |
7 | fn main() {}
8 |
--------------------------------------------------------------------------------
/examples/diesel-async-postgres/migrations/2023-03-14-180127_add_users/up.sql:
--------------------------------------------------------------------------------
1 | -- Your SQL goes here
2 | CREATE TABLE "users"(
3 | "id" SERIAL PRIMARY KEY,
4 | "name" TEXT NOT NULL,
5 | "hair_color" TEXT
6 | );
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/pass/associated_fn_without_self.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 |
3 | struct A;
4 |
5 | impl A {
6 | #[debug_handler]
7 | async fn handler() {}
8 | }
9 |
10 | fn main() {}
11 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/pass/ready.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 | use std::future::{ready, Ready};
3 |
4 | #[debug_handler]
5 | fn handler() -> Ready<()> {
6 | ready(())
7 | }
8 |
9 | fn main() {}
10 |
--------------------------------------------------------------------------------
/axum-macros/tests/from_ref/pass/reference-types.rs:
--------------------------------------------------------------------------------
1 | #![deny(noop_method_call)]
2 |
3 | use axum_macros::FromRef;
4 |
5 | #[derive(FromRef)]
6 | struct State {
7 | inner: &'static str,
8 | }
9 |
10 | fn main() {}
11 |
--------------------------------------------------------------------------------
/axum-macros/tests/typed_path/fail/missing_field.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::TypedPath;
2 | use serde::Deserialize;
3 |
4 | #[derive(TypedPath, Deserialize)]
5 | #[typed_path("/users/{id}")]
6 | struct MyPath {}
7 |
8 | fn main() {}
9 |
--------------------------------------------------------------------------------
/axum-macros/tests/typed_path/fail/unit_with_capture.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::TypedPath;
2 | use serde::Deserialize;
3 |
4 | #[derive(TypedPath, Deserialize)]
5 | #[typed_path("/users/{id}")]
6 | struct MyPath;
7 |
8 | fn main() {}
9 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/not_send.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 |
3 | #[debug_handler]
4 | async fn handler() {
5 | let _rc = std::rc::Rc::new(());
6 | async {}.await;
7 | }
8 |
9 | fn main() {}
10 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/pass/deny_unreachable_code.rs:
--------------------------------------------------------------------------------
1 | #![deny(unreachable_code)]
2 |
3 | use axum::extract::Path;
4 |
5 | #[axum_macros::debug_handler]
6 | async fn handler(Path(_): Path) {}
7 |
8 | fn main() {}
9 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/pass/mut_extractor.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 |
3 | #[debug_handler]
4 | async fn handler(mut foo: String) -> String {
5 | foo += "bar";
6 | foo
7 | }
8 |
9 | fn main() {}
10 |
--------------------------------------------------------------------------------
/examples/templates-minijinja/templates/about.jinja:
--------------------------------------------------------------------------------
1 | {% extends "layout" %}
2 | {% block title %}{{ super() }} | {{ title }} {% endblock %}
3 | {% block body %}
4 | {{ title }}
5 | {{ about_text }}
6 | {% endblock %}
7 |
--------------------------------------------------------------------------------
/examples/templates-minijinja/templates/home.jinja:
--------------------------------------------------------------------------------
1 | {% extends "layout" %}
2 | {% block title %}{{ super() }} | {{ title }} {% endblock %}
3 | {% block body %}
4 | {{ title }}
5 | {{ welcome_text }}
6 | {% endblock %}
7 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/pass/multiple_extractors.rs:
--------------------------------------------------------------------------------
1 | use axum::http::{Method, Uri};
2 | use axum_macros::debug_handler;
3 |
4 | #[debug_handler]
5 | async fn handler(_one: Method, _two: Uri, _three: String) {}
6 |
7 | fn main() {}
8 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/pass/request_last.rs:
--------------------------------------------------------------------------------
1 | use axum::extract::{Extension, Request};
2 | use axum_macros::debug_handler;
3 |
4 | #[debug_handler]
5 | async fn handler(_: Extension, _: Request) {}
6 |
7 | fn main() {}
8 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/fail/json_not_deserialize.rs:
--------------------------------------------------------------------------------
1 | use axum::Json;
2 | use axum_macros::debug_handler;
3 |
4 | struct Struct {}
5 |
6 | #[debug_handler]
7 | async fn handler(_foo: Json) {}
8 |
9 | fn main() {}
10 |
--------------------------------------------------------------------------------
/axum-macros/tests/debug_handler/pass/impl_future.rs:
--------------------------------------------------------------------------------
1 | use axum_macros::debug_handler;
2 | use std::future::Future;
3 |
4 | #[debug_handler]
5 | fn handler() -> impl Future