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
//! Storage models, split by the job each type does (D28).
//!
//! Before this split one file held row structs, response DTOs, domain enums,
//! wire constants and a handler helper, and two more row structs lived in the
//! repositories that happened to read them. There was no answer to "where does
//! a new type go?", and the cost of that showed up as [`rows::Trace`] doing
//! three jobs at once — a table picture, a wire shape, and the carrier of a
//! credential verifier (D27).
//!
//! The rule, by module:
//!
//! | Module | Holds | Derives |
//! |---|---|---|
//! | [`rows`] | one struct per `SELECT` shape | `FromRow`, never `Serialize`/`ToSchema` |
//! | [`dto`] | one struct per response body | `Serialize + ToSchema` |
//! | [`enums`] | closed value sets and the string constants for them | both, freely |
//!
//! **Request** DTOs stay next to the repository method that consumes them:
//! they are that method's input contract, they carry its validation, and they
//! have no row to be confused with.
//!
//! A row reaches the wire only through a `From`/`TryFrom` into a [`dto`] type.
//! That is enforced, not merely documented — see
//! `rows::tests::row_structs_are_not_wire_types` and
//! `no_storage_row_struct_is_published_unless_it_is_the_wire_shape` in
//! `server::routes::openapi`.
pub use ;
pub use ;
pub use ;