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
//! Interaction paradigm traits for elicitation patterns.
use cratePrompt;
/// Select one value from a finite set (dropdown/radio button pattern).
///
/// This trait represents the conversational equivalent of a dropdown menu or
/// radio button group. It is the natural elicitation mode for enums and
/// categorical fields.
///
/// # Owned Returns for Flexibility
///
/// All methods return owned data (Vec<T>, Vec<String>) rather than static slices.
/// This allows implementations for both compile-time enums and runtime collections
/// like `Vec<T>` and `HashMap<K, V>`.
///
/// # Example
///
/// ```rust,no_run
/// use elicitation::{Select, Prompt};
///
/// #[derive(Debug, Clone, Copy)]
/// enum Color {
/// Red,
/// Green,
/// Blue,
/// }
///
/// impl Prompt for Color {
/// fn prompt() -> Option<&'static str> {
/// Some("Choose a color:")
/// }
/// }
///
/// impl Select for Color {
/// fn options() -> Vec<Self> {
/// vec![Color::Red, Color::Green, Color::Blue]
/// }
///
/// fn labels() -> Vec<String> {
/// vec!["Red".to_string(), "Green".to_string(), "Blue".to_string()]
/// }
///
/// fn from_label(label: &str) -> Option<Self> {
/// match label {
/// "Red" => Some(Color::Red),
/// "Green" => Some(Color::Green),
/// "Blue" => Some(Color::Blue),
/// _ => None,
/// }
/// }
/// }
/// ```
/// Collection-level filtering for selection options.
///
/// Enables filtering `Select` options based on runtime predicates.
/// Blanket implementation for closure-based filtering.
/// Binary confirmation (yes/no, true/false pattern).
///
/// This trait represents a yes/no confirmation dialog. It is the natural
/// elicitation mode for boolean fields and confirmation prompts.
///
/// # Example
///
/// ```rust
/// use elicitation::Affirm;
///
/// // bool implements Affirm by default
/// fn requires_affirm<T: Affirm>() {}
/// requires_affirm::<bool>();
/// ```
/// Multi-field structured elicitation (form/wizard pattern).
///
/// This trait represents a multi-step form or wizard. It is the natural
/// elicitation mode for structs and configuration objects.
///
/// The derive macro generates implementations of this trait for structs,
/// creating a state machine that elicits each field in sequence.
/// Metadata for a single survey field.
/// Permission-granting interaction with policy choices.
///
/// This trait represents a permission dialog with multiple policy options.
/// It is used for authorization decisions and policy selection.
///
/// **Note**: Implementation of this paradigm is planned for v0.2.0.