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
use cratePath;
use ;
/// Trait for embedded types that are flattened into their parent model's table.
///
/// Embedded types don't have their own tables or primary keys. They can't be
/// queried independently or used as relation targets. Their fields are flattened
/// into the parent model's table columns.
///
/// Embedded types are never registered directly by the user — they are
/// discovered transitively through the fields of the models (and other embeds)
/// that contain them, via [`Field::register`](super::Field::register).
/// An embedded type that can be constructed as a write value through a
/// builder: an enum with data-carrying variants.
///
/// `create!` and `update!` expand a variant literal
/// (`Owner::Human { human: &alice }`) into a chain on
/// [`Create`](Self::Create): `<Owner as EmbedCreate>::create().human().human(&alice)`.