1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
//! # Autumn
//!
//! An opinionated, convention-over-configuration web framework for Rust.
//!
//! Autumn assembles proven Rust crates ([Axum], [Maud], [Diesel], htmx, Tailwind)
//! into a Spring Boot-style developer experience with proc-macro-driven
//! conventions and customization options at every level.
//!
//! ## Quick start
//!
//! ```rust,no_run
//! use autumn_web::prelude::*;
//!
//! #[get("/")]
//! async fn index() -> Markup {
//! html! { h1 { "Hello, Autumn!" } }
//! }
//!
//! #[autumn_web::main]
//! async fn main() {
//! autumn_web::app()
//! .routes(routes![index])
//! .run()
//! .await;
//! }
//! ```
//!
//! ## Architecture overview
//!
//! | Layer | Crate | Purpose |
//! |-------|-------|---------|
//! | HTTP server | [Axum] | Routing, extractors, middleware |
//! | HTML templates | [Maud] | Type-safe, compiled HTML via `html!` macro |
//! | Database | [Diesel] | Async Postgres via `diesel-async` + deadpool |
//! | Client interactivity | htmx | Embedded JS served from same-origin `/static/js/` routes |
//! | Styling | Tailwind CSS | Downloaded + managed by `autumn-cli` |
//!
//! ## Modules
//!
//! - [`mod@app`] -- Application builder for configuring and launching the server.
//! - [`config`] -- Layered configuration: defaults, `autumn.toml`, env overrides.
//! - [`db`] -- Database connection pool and the [`Db`] request extractor.
//! - [`error`] -- Framework error type ([`AutumnError`]) and result alias.
//! - [`extract`] -- Re-exported Axum extractors ([`Form`],
//! [`Json`], [`Path`], [`Query`], and optional multipart support).
//! - [`health`] -- Compatibility alias for readiness plus legacy health helpers.
//! - [`middleware`] -- Built-in middleware (request IDs).
//! - [`pagination`] -- Standardized `page`/`size` extractor and response wrapper.
//! - [`prelude`] -- Glob import for the most common types.
//!
//! ## Zero-config defaults
//!
//! An Autumn app runs out of the box with no configuration file. Every
//! setting has a sensible default (port 3000, `info` log level, etc.).
//! Override via `autumn.toml` or `AUTUMN_*` environment variables.
//! See [`config::AutumnConfig`] for the full list.
//!
//! [Axum]: https://docs.rs/axum
//! [Maud]: https://maud.lambda.xyz
//! [Diesel]: https://diesel.rs
// Allow `::autumn_web::` paths generated by proc macros to resolve
// within this crate itself (needed for tests and doctests).
extern crate self as autumn_web;
pub use ;
/// Translation lookup macro with compile-time key validation.
///
/// Re-exported from [`crate::i18n::t`] for ergonomic
/// `autumn_web::t!(locale, "key")` usage.
pub use cratet;
pub use ;
pub use RepositoryError;
/// Router construction and integration with Axum.
///
/// This module is responsible for taking the application's configuration,
/// defined routes, middleware, and state, and building the final `axum::Router`
/// that will handle incoming HTTP requests.
pub
pub use ;
pub
pub
pub use PathExt;
pub
pub use ;
pub
/// Static site generation support.
/// Changeset type carrying submitted values + per-field errors.
pub use Changeset;
/// Changeset form extractor — decodes body + validates, captures errors in [`form::Changeset`].
pub use ChangesetForm;
/// Trait implemented for all `validator::Validate` types to produce a [`Changeset`].
pub use IntoChangeset;
/// Private runtime helpers for code generated by Autumn proc macros.
///
/// This module is semver-exempt. Do not use it directly.
/// Create a new [`app::AppBuilder`] for configuring and launching an Autumn server.
///
/// This is the primary entry point for every Autumn application.
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[get("/")]
/// async fn index() -> &'static str { "hello" }
///
/// #[autumn_web::main]
/// async fn main() {
/// autumn_web::app()
/// .routes(routes![index])
/// .run()
/// .await;
/// }
/// ```
pub use app;
/// Async database connection extractor.
///
/// Declare `db: Db` in a handler signature to get a pooled Postgres
/// connection. See [`db::Db`] for full documentation and examples.
pub use Db;
/// Framework error type and result alias.
///
/// [`AutumnError`] wraps any `Error + Send + Sync` with an HTTP status code.
/// [`AutumnResult<T>`] is `Result<T, AutumnError>`.
/// See the [`error`] module for details.
pub use ;
/// Paginated list response wrapper with navigation metadata.
///
/// See the [`pagination`] module for the full query contract and usage
/// patterns.
pub use Page;
/// Pagination parameters extracted from the query string.
///
/// See the [`pagination`] module for the full query contract and usage
/// patterns.
pub use PageRequest;
/// Cursor pagination response wrapper. Companion to [`CursorRequest`]
/// for keyset/seek pagination of real-time feeds.
///
/// See the [`pagination`] module for the full query contract and usage
/// patterns.
pub use CursorPage;
/// Cursor pagination parameters extracted from the query string.
///
/// See the [`pagination`] module for the full query contract and usage
/// patterns.
pub use CursorRequest;
/// Auto-validating extractor. Wraps `Json<T>`, `Form<T>`, or `Query<T>`
/// and validates via `validator::Validate` before the handler runs.
/// Returns 422 with structured error details on validation failure.
pub use Valid;
/// Proof that `T` has passed validation. See [`validation`] module.
pub use Validated;
/// htmx version string embedded in the binary.
///
/// Useful for cache-busting or diagnostic logging. The corresponding
/// minified JS is served automatically at `/static/js/htmx.min.js`.
pub use ;
pub use ;
/// Extension trait adding `.validate()` to all `validator::Validate` types.
pub use ValidateExt;
// ── Proc-macro re-exports ──────────────────────────────────────────
/// Annotate an async function as a `DELETE` route handler.
///
/// Generates a companion function that returns a [`crate::route::Route`]
/// pairing the path with an Axum handler. In debug builds
/// `#[axum::debug_handler]` is applied automatically for better error
/// messages (zero cost in release).
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[delete("/items/{id}")]
/// async fn remove_item() -> &'static str {
/// "removed"
/// }
/// ```
pub use delete;
/// Enrich a route handler's auto-generated `OpenAPI` documentation.
///
/// See the [`openapi`] module and the [`autumn_macros::api_doc`]
/// attribute docs for details on the supported keys.
///
/// # Example
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[get("/users/{id}")]
/// #[api_doc(summary = "Fetch a user by id", tag = "users")]
/// async fn get_user(Path(id): Path<i32>) -> String {
/// format!("User {id}")
/// }
/// ```
pub use api_doc;
/// Annotate an async function as a `GET` route handler.
///
/// Generates a companion function that returns a [`crate::route::Route`]
/// pairing the path with an Axum handler. In debug builds
/// `#[axum::debug_handler]` is applied automatically for better error
/// messages (zero cost in release).
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[get("/hello")]
/// async fn hello() -> &'static str {
/// "Hello, Autumn!"
/// }
/// ```
pub use get;
/// Collect mailer preview registrations into an `AppBuilder`.
pub use mail_previews;
/// Generate ergonomic `send_*` and `deliver_later_*` helpers for mailer impls.
pub use mailer;
/// Register zero-argument mail template previews for the dev mail UI.
pub use mailer_preview;
/// Set up the Tokio async runtime for an Autumn application.
///
/// A thin wrapper around `#[tokio::main]`. The real framework setup
/// happens inside [`app::AppBuilder::run`].
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[get("/")]
/// async fn index() -> &'static str { "hi" }
///
/// #[autumn_web::main]
/// async fn main() {
/// autumn_web::app()
/// .routes(routes![index])
/// .run()
/// .await;
/// }
/// ```
pub use main;
/// Derive Diesel and Serde traits for a database model struct.
///
/// Applies `Queryable`, `Selectable`, `Insertable`, `Serialize`, and
/// `Deserialize` derives plus a `#[diesel(table_name = ...)]` attribute.
/// The table name is either specified explicitly or inferred from the
/// struct name (`PascalCase` -> `snake_case` + `s`).
///
/// # Examples
///
/// Explicit table name:
///
/// ```rust,ignore
/// use autumn_web::model;
///
/// #[model(table = "users")]
/// pub struct User {
/// pub id: i64,
/// pub name: String,
/// }
/// ```
///
/// Inferred table name (`BlogPost` -> `blog_posts`):
///
/// ```rust,ignore
/// use autumn_web::model;
///
/// #[model]
/// pub struct BlogPost {
/// pub id: i64,
/// pub title: String,
/// }
/// ```
pub use model;
/// Annotate an OAuth2/OIDC callback handler.
///
/// Convenience alias for `#[get(...)]` with callback-focused naming.
pub use oauth2_callback;
/// Derive a repository with CRUD operations and derived queries.
///
/// See [`macro@repository`] for details.
pub use repository;
/// Define a service for cross-model orchestration and non-DB side effects.
///
/// Generates a `XxxServiceImpl` struct with dependency injection.
/// Use when logic spans multiple repositories or involves non-DB work.
/// For single-model CRUD, use [`macro@repository`] instead.
///
/// # Examples
///
/// ```rust,ignore
/// use autumn_web::service;
///
/// #[service]
/// pub trait OrderService {
/// fn deps(order_repo: PgOrderRepository, inventory_repo: PgInventoryRepository);
/// }
///
/// impl OrderServiceImpl {
/// pub async fn place_order(&self, req: PlaceOrderRequest) -> AutumnResult<Order> {
/// let order = self.order_repo.save(&req.into()).await?;
/// self.inventory_repo.reserve(order.id).await?;
/// Ok(order)
/// }
/// }
/// ```
pub use service;
/// Annotate an async function as a `PATCH` route handler.
///
/// Generates a companion function that returns a [`crate::route::Route`]
/// and a typed `__autumn_path_{name}(…) -> String` path helper.
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::patch;
///
/// #[patch("/items/{id}")]
/// async fn patch_item() -> &'static str {
/// "patched"
/// }
/// ```
pub use patch;
/// Emit a `pub mod paths { … }` re-exporting typed path helpers.
///
/// Takes the same comma-separated handler list as [`routes!`]. Invoke once
/// in the module where your handlers live:
///
/// ```ignore
/// autumn_web::paths![show_post, create_post];
/// // callers can then: use crate::routes::paths;
/// // paths::show_post(42)
/// ```
pub use paths;
/// HTTP redirect response.
///
/// Re-exported from [Axum](https://docs.rs/axum) so route handlers can
/// return a redirect without a direct `axum` dependency.
///
/// Use [`Redirect::to`] with a path helper:
///
/// ```ignore
/// use autumn_web::Redirect;
/// Redirect::to(&paths::show_post(id))
/// ```
pub use Redirect;
/// Annotate an async function as a `POST` route handler.
///
/// Generates a companion function that returns a [`crate::route::Route`]
/// pairing the path with an Axum handler. In debug builds
/// `#[axum::debug_handler]` is applied automatically for better error
/// messages (zero cost in release).
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[post("/items")]
/// async fn create_item() -> &'static str {
/// "created"
/// }
/// ```
pub use post;
/// Annotate an async function as a `PUT` route handler.
///
/// Generates a companion function that returns a [`crate::route::Route`]
/// pairing the path with an Axum handler. In debug builds
/// `#[axum::debug_handler]` is applied automatically for better error
/// messages (zero cost in release).
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[put("/items/{id}")]
/// async fn update_item() -> &'static str {
/// "updated"
/// }
/// ```
pub use put;
/// Collect route-annotated handlers into a `Vec<Route>`.
///
/// Each handler must have been annotated with a route macro ([`get`],
/// [`post`], [`put`], [`delete`]) which generates a companion
/// `__autumn_route_info_{name}()` function.
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[get("/hello")]
/// async fn hello() -> &'static str { "hello" }
///
/// #[post("/create")]
/// async fn create() -> &'static str { "created" }
///
/// # #[autumn_web::main]
/// # async fn main() {
/// let all_routes = routes![hello, create];
/// autumn_web::app().routes(all_routes).run().await;
/// # }
/// ```
pub use routes;
/// Cache the return value of a function based on its arguments.
///
/// Wraps a function with an in-memory cache backed by a static
/// [`MokaCache`](cache::MokaCache) (default) via the [`Cache`](cache::Cache)
/// trait. Arguments must implement `Hash + Clone`; the return type must
/// be `Clone + Send + Sync + 'static`.
///
/// Use `result` to only cache `Ok` values from `Result`-returning
/// functions (common with [`AutumnResult`]).
///
/// # Examples
///
/// ```rust,ignore
/// use autumn_web::cached;
///
/// #[cached(ttl = "5m", max = 100, result)]
/// async fn get_user(id: i64) -> AutumnResult<User> {
/// db.find(id).await
/// }
/// ```
pub use cached;
/// Annotate an async function as a WebSocket route handler.
///
/// The function follows the **two-function pattern**: it runs at HTTP
/// upgrade time and returns a closure implementing [`ws::WsHandler`]
/// that handles the live WebSocket connection.
///
/// Generates a GET route for the WebSocket upgrade, compatible with
/// [`routes!`]. Requires the `ws` feature.
///
/// # Examples
///
/// ```rust,ignore
/// use autumn_web::prelude::*;
/// use autumn_web::ws::{WebSocket, Message, WsHandler};
///
/// #[ws("/echo")]
/// async fn echo() -> impl WsHandler {
/// |mut socket: WebSocket| async move {
/// while let Some(Ok(msg)) = socket.recv().await {
/// if let Message::Text(text) = msg {
/// socket.send(Message::Text(text)).await.ok();
/// }
/// }
/// }
/// }
/// ```
pub use ws;
/// Declare an on-demand background job. See [`mod@job`] module.
pub use job;
/// Declare a scheduled background task. See [`mod@task`] module.
pub use scheduled;
/// Declare a one-off operational task. See [`task::OneOffTaskInfo`].
pub use task;
/// Extractor that yields a verified bearer-token principal for API routes.
///
/// Must be used with [`auth::RequireApiToken`] middleware. See the
/// [`auth`] module for a complete quick-start example.
pub use ApiToken;
/// Tower layer that validates `Authorization: Bearer <token>` on API routes.
///
/// Verifies tokens against any [`auth::ApiTokenStore`] implementation.
/// Returns `401 Unauthorized` for missing, unknown, or revoked tokens.
pub use RequireApiToken;
/// Postgres-backed API token store (requires `db` feature).
///
/// Production replacement for [`auth::InMemoryApiTokenStore`]. Hashes tokens
/// at rest and persists them across restarts. Use with [`API_TOKEN_MIGRATIONS`]
/// for dev/test startup checks; `autumn migrate` applies the token-table
/// framework migration in production.
pub use DbApiTokenStore;
/// Embedded Diesel migrations for the `api_tokens` table (requires `db` feature).
///
/// Pass to `app().migrations()` so that dev/test startup migration checks can
/// create and validate the `api_tokens` table alongside your application
/// migrations.
pub use API_TOKEN_MIGRATIONS;
/// Secure a route handler with authentication and optional role checks.
///
/// Applied before a route macro (`#[get]`, `#[post]`, etc.), this attribute
/// injects an authentication guard at the top of the handler. The guard
/// checks the session for the configured auth key (default: `"user_id"`)
/// and, when roles are specified, verifies the user's role matches.
///
/// Returns `401 Unauthorized` if not authenticated, or `403 Forbidden`
/// if the user lacks the required role.
///
/// The handler must return [`AutumnResult<T>`] so the guard can use `?`
/// to short-circuit on failure.
///
/// # Forms
///
/// - `#[secured]` -- require authentication only
/// - `#[secured("admin")]` -- require a specific role
/// - `#[secured("admin", "editor")]` -- require any of the listed roles
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[get("/dashboard")]
/// #[secured]
/// async fn dashboard() -> AutumnResult<&'static str> {
/// Ok("welcome")
/// }
///
/// #[get("/admin")]
/// #[secured("admin")]
/// async fn admin_panel() -> AutumnResult<&'static str> {
/// Ok("admin area")
/// }
///
/// #[get("/content")]
/// #[secured("admin", "editor")]
/// async fn manage_content() -> AutumnResult<&'static str> {
/// Ok("content manager")
/// }
/// ```
pub use secured;
/// Enforce a record-level [`Policy`](crate::authorization::Policy)
/// before a handler runs. Coexists with [`secured`](macro@secured):
/// `#[secured]` answers "are you in?", `#[authorize]` answers
/// "are you allowed to act on *this record*?"
///
/// # Examples
///
/// ```rust,ignore
/// use autumn_web::prelude::*;
///
/// #[get("/posts/{id}/edit")]
/// #[authorize("update", resource = Post)]
/// async fn edit_post(post: Post) -> AutumnResult<Markup> {
/// Ok(html! { h1 { (post.title) } })
/// }
/// ```
pub use authorize;
/// Collect `#[job]` handlers into a `Vec<JobInfo>`.
pub use jobs;
/// Collect `#[task]` handlers into a `Vec<task::OneOffTaskInfo>`.
pub use one_off_tasks;
/// Collect `#[scheduled]` task handlers into a `Vec<TaskInfo>`.
pub use tasks;
/// Collect `#[static_get]` handlers into a `Vec<StaticRouteMeta>`.
pub use static_routes;
/// Annotate an async function as a statically pre-rendered GET route.
///
/// Like [`get`], this generates a route companion for Axum routing.
/// Additionally, it emits a `__autumn_static_meta_{name}()` companion
/// that registers the route for static HTML generation at build time
/// (`autumn build`).
///
/// Phase 1 restriction: path parameters (`{id}`) are **not** supported.
/// Use [`get`] for parameterized routes.
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[static_get("/about")]
/// async fn about() -> &'static str {
/// "About us"
/// }
/// ```
pub use static_get;
// ── Maud re-exports ────────────────────────────────────────────────
/// Rendered HTML fragment produced by the [`html!`] macro.
///
/// This is the standard return type for handlers that render HTML.
/// Re-exported from [Maud](https://maud.lambda.xyz).
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[get("/")]
/// async fn index() -> Markup {
/// html! { h1 { "Welcome" } }
/// }
/// ```
pub use Markup;
/// Wrap a pre-escaped string so Maud renders it verbatim.
///
/// Use this when you have HTML that was already escaped or generated
/// by another system and you want to embed it in a Maud template
/// without double-escaping.
///
/// Re-exported from [Maud](https://maud.lambda.xyz).
///
/// # Examples
///
/// ```rust
/// use autumn_web::PreEscaped;
///
/// let raw_html = PreEscaped("<em>already escaped</em>".to_string());
/// ```
pub use PreEscaped;
/// Type-safe HTML templating macro.
///
/// Produces a [`Markup`] value containing compiled HTML.
/// Re-exported from [Maud](https://maud.lambda.xyz). See the
/// [Maud book](https://maud.lambda.xyz) for full syntax reference.
///
/// # Examples
///
/// ```rust
/// use autumn_web::html;
///
/// let greeting = "world";
/// let page = html! {
/// h1 { "Hello, " (greeting) "!" }
/// };
/// ```
pub use html;
/// JSON request body extractor and response type.
///
/// When used as a handler parameter, deserializes the request body as JSON.
/// When returned from a handler, serializes the value as JSON with
/// `Content-Type: application/json`.
///
/// Wraps [Axum](https://docs.rs/axum)'s JSON extractor so parse failures use
/// Autumn's Problem Details error contract.
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
/// use serde::{Deserialize, Serialize};
///
/// #[derive(Deserialize)]
/// struct CreateItem { name: String }
///
/// #[derive(Serialize)]
/// struct Item { id: i64, name: String }
///
/// #[post("/items")]
/// async fn create(Json(input): Json<CreateItem>) -> Json<Item> {
/// Json(Item { id: 1, name: input.name })
/// }
/// ```
pub use crateJson;
/// Path extractor.
///
/// Extract typed path parameters from the URL.
///
/// Wraps [Axum](https://docs.rs/axum)'s path extractor so parse failures use
/// Autumn's Problem Details error contract.
///
/// # Examples
///
/// ```rust,no_run
/// use autumn_web::prelude::*;
///
/// #[get("/users/{id}")]
/// async fn get_user(Path(id): Path<i32>) -> String {
/// format!("User {id}")
/// }
/// ```
pub use cratePath;
/// Form data extractor.
pub use crateForm;
/// Query extractor.
pub use crateQuery;
/// State extractor.
/// Re-exported from [Axum](https://docs.rs/axum).
pub use State;
/// Re-exports of upstream crates used in macro-generated code.
///
/// These are public so that code generated by `autumn-macros` can reference
/// them as `autumn_web::reexports::axum`, etc. without requiring the user to
/// add those crates as direct dependencies.
///
/// **For advanced use cases only.** Prefer the types re-exported in
/// [`prelude`] or at the crate root. Reach into `reexports` when you
/// need direct access to the underlying framework types (e.g.,
/// `autumn_web::reexports::axum::Router` for custom middleware).
///
/// # Available crates
///
/// | Crate | Re-exported as | Use case |
/// |-------|---------------|----------|
/// | `axum` | `autumn_web::reexports::axum` | Custom routers, middleware, extractors |
/// | `diesel` | `autumn_web::reexports::diesel` | Raw Diesel queries, schema types |
/// | `http` | `autumn_web::reexports::http` | HTTP types (`StatusCode`, `Method`, headers) |
/// | `serde_json` | `autumn_web::reexports::serde_json` | JSON values and conversion helpers |
/// | `tokio` | `autumn_web::reexports::tokio` | Async runtime, spawn, timers |
/// Shared application state passed to route handlers.
pub
pub use AppState;