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
//! Core type definitions and parsing implementations for field injection.
//!
//! This module defines the fundamental data structures and parsing traits used
//! throughout the crate for managing field injection, including module information,
//! field definitions, and configuration parsing.
use ;
/// Information about a module and its injectable fields.
///
/// This struct maintains metadata about an injectable struct, including its fields
/// and module path information.
///
/// # Fields
///
/// * `fields` - Vector of field definitions from the struct
/// * `module_path` - Full path to the module containing the struct
/// Definition of an injectable field.
///
/// Contains all necessary information about a field that can be injected into
/// other structs, including its name, type, visibility, and any generic parameters.
///
/// # Fields
///
/// * `name` - Name of the field
/// * `ty` - Type of the field as a string
/// * `vis` - Visibility of the field
/// * `generic_params` - Names of generic type parameters if any
///
/// # Examples
///
/// ```rust,ignore
/// # use crate::visibility::VisibilityKind;
/// # use crate::types::FieldDef;
/// let field = FieldDef {
/// name: "id".to_string(),
/// ty: "u64".to_string(),
/// vis: VisibilityKind::Public,
/// generic_params: vec![],
/// };
/// ```
/// Type information for a field during processing.
///
/// Used during field injection to track type and visibility information
/// as fields are processed and validated.
///
/// # Fields
///
/// * `name` - Name of the field
/// * `ty` - Type of the field
/// * `vis` - Visibility of the field
/// Configuration for field injection.
///
/// Parsed from the attribute arguments of `#[inject_fields(...)]`,
/// containing the source structs to inject fields from.
///
/// # Fields
///
/// * `structs` - Vector of type paths representing source structs
///
/// # Examples
///
/// ```rust,ignore
/// // The macro invocation #[inject_fields(UserData, Timestamps)]
/// // would parse into an InjectConfig containing two TypePaths
/// ```
/// Error type for injection-related failures.
///
/// Wraps a string error message describing what went wrong during
/// the injection process.
///
/// # Examples
///
/// ```rust,ignore
/// # use crate::types::InjectionError;
/// let error = InjectionError("Cannot inject private field".to_string());
/// ```
;