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
//! # Former Types - Core Trait Definitions and Type System Integration
//!
//! This crate provides the foundational trait definitions and type system integration
//! for the Former builder pattern ecosystem. It defines the core abstractions that
//! enable flexible and extensible builder pattern implementations.
//!
//! ## Core Abstractions
//!
//! ### Formation Process Management
//! The crate defines several key traits that manage the formation process:
//!
//! - **[`FormerDefinition`]**: Links entities to their formation definitions
//! - **[`FormerDefinitionTypes`]**: Specifies storage, formed, and context types
//! - **[`FormingEnd`]**: Handles completion of the formation process
//! - **[`FormerMutator`]**: Enables pre-formation data validation and manipulation
//! - **[`FormerBegin`]**: Initiates subform creation with proper context
//!
//! ### Storage Management
//! - **[`Storage`]**: Defines the interface for temporary state during formation
//! - **[`StoragePreform`]**: Handles transition from storage to final formed state
//!
//! ### Collection Integration
//! Specialized support for collection types when the `types_former` feature is enabled:
//! - Automatic trait implementations for standard collections
//! - Custom collection support through extensible trait system
//! - Type-safe collection builders with proper generic handling
//!
//! ## Architecture Design
//!
//! ### Type Safety and Generics
//! The trait system is designed to handle complex generic scenarios:
//! - **Lifetime Parameters**: Full support for complex lifetime relationships
//! - **Generic Constraints**: Proper constraint propagation through the type system
//! - **Associated Types**: Clean separation of concerns through associated types
//!
//! ### Builder Pattern Integration
//! The traits work together to enable:
//! - **Fluent Interfaces**: Method chaining with compile-time validation
//! - **Subform Support**: Nested builders with proper context preservation
//! - **Custom Validation**: Pre-formation validation and transformation
//! - **Flexible End Conditions**: Customizable formation completion logic
//!
//! ## Feature Gates
//!
//! - **`types_former`**: Enables core Former trait definitions
//! - **`use_alloc`**: Enables allocation-dependent features in no-std environments
//! - **`no_std`**: Full no-std compatibility when used without std-dependent features
//!
//! ## Integration with Former Ecosystem
//!
//! This crate serves as the foundation for:
//! - **[`former`]**: Main user-facing crate with derive macro
//! - **[`former_meta`]**: Procedural macro implementation
//! - **Collection Tools**: Integration with external collection libraries
//!
//! ## Usage Patterns
//!
//! Most users will not interact with this crate directly, but will instead use
//! the higher-level [`former`] crate. However, this crate is essential for:
//! - Custom Former implementations
//! - Integration with external libraries
//! - Advanced builder pattern scenarios
/// ## Formation Definition System
///
/// Core trait definitions that establish the relationship between entities and their
/// formation processes. Defines how types are linked to their builders, storage
/// mechanisms, and completion handlers.
///
/// Key traits: [`FormerDefinition`], [`FormerDefinitionTypes`], entity mapping traits.
/// ## Formation Process Management
///
/// Traits and types that manage the formation lifecycle, including process initiation,
/// mutation, and completion. Provides the foundational abstractions for controlling
/// how entities are constructed through the builder pattern.
///
/// Key traits: [`FormingEnd`], [`FormerMutator`], [`FormerBegin`], completion handlers.
/// ## Storage Interface System
///
/// Defines the storage mechanisms that maintain intermediate state during entity
/// formation. Provides traits for managing temporary data and transforming it
/// into final formed structures.
///
/// Key traits: [`Storage`], [`StoragePreform`], storage lifecycle management.
/// ## Collection Interface System
///
/// Provides specialized support for collection types within the Former pattern.
/// Defines traits and implementations that enable seamless integration with
/// standard collections like Vec, HashMap, HashSet, and custom collection types.
///
/// ### Key Features
/// - Entry-to-value conversion abstractions
/// - Value-to-entry transformation support
/// - Collection-specific builder patterns
/// - Type-safe collection manipulation
///
/// This module is only available with std or when the `use_alloc` feature is enabled.
/// ## Namespace with dependencies
///
/// Exposes the external dependencies used by `former_types` for advanced integration
/// scenarios and custom implementations.
///
/// ### Dependencies
/// - [`collection_tools`]: Comprehensive collection manipulation utilities
///
/// ### Usage
/// This namespace is primarily intended for library authors and advanced users
/// who need direct access to the underlying collection tools for custom Former
/// implementations or specialized collection handling.
pub use *;
/// Own namespace of the module.
/// Parented namespace of the module.
/// Exposed namespace of the module.
/// Prelude to use essentials: `use my_module::prelude::*`.