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
//! Runtime-queryable structural registry for elicitation types.
//!
//! Each composite type registered via `#[derive(Elicit)]` submits a
//! [`TypeGraphKey`] that stores a `fn() -> TypeMetadata`. The graph builder
//! uses [`lookup_type_graph`] to traverse field/variant edges without
//! monomorphized generics.
//!
//! # Registration
//!
//! Types register automatically when `#[derive(Elicit)]` is used and the
//! `graph` feature is enabled. Manual registration uses `inventory::submit!`:
//!
//! ```rust,ignore
//! inventory::submit!(elicitation::TypeGraphKey::new(
//! "MyType",
//! <MyType as elicitation::ElicitIntrospect>::metadata,
//! ));
//! ```
use crateTypeMetadata;
/// Registration key for the global type graph inventory.
///
/// Stores a `fn() -> TypeMetadata` so the graph builder can reconstruct
/// full structural information (fields, variant fields) at runtime by name.
collect!;
/// Look up structural metadata for a type by name.
///
/// Returns `None` if no [`TypeGraphKey`] has been submitted for that name.
/// Unknown names are treated as primitive leaf nodes by the graph builder.
/// All registered graphable type names.
///
/// Useful for tooling that needs to enumerate what can be visualized
/// (e.g. `elicitation graph --list` or `type_graph__list_types`).