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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
//! # Neocrates
//!
//! A comprehensive Rust toolkit targeting Web, AWS, Database, Redis, and Cryptography scenarios.
//!
//! Modules and their dependencies are gated by features for tree-shaking. The middleware uses a pluggable TokenStore and only requires the "web" feature. When the "redis" feature is enabled, you can provide a Redis-backed store; otherwise an in-memory store is used by default.
//!
//! ## Feature Groups
//!
//! - web: Web capabilities (Axum/Tower/Hyper, HTTP, URL handling, common middleware and response utilities)
//! - aws: AWS capabilities (aws-config, aws-types, S3, STS). Note: `aws` includes shared S3/STS dependencies
//! - awss3: S3-only (requires aws-sdk-s3 + shared aws-config/types)
//! - awssts: STS-only (requires aws-sdk-sts + shared aws-config/types)
//! - database: Database and Diesel capabilities (diesel, deadpool/connection pooling, migrations)
//! - redis: Redis and caching (redis, bb8, bb8-redis, moka)
//! - crypto: Cryptography and hashing (argon2, hmac, ring, sha2)
//! - sms: SMS-related modules (if they depend on HTTP, enable together with "web")
//! - full: Enable all features
//!
//! Note: Modules are compiled only when their feature is enabled; related dependencies are marked optional in Cargo.toml and aggregated via
//! the `[features]` section. See the example below.
//!
//! ## Cargo.toml Example
//!
//! ```toml
//! [features]
//! default = []
//! # Aggregated features
//! web = ["dep:axum", "dep:tower", "dep:tower-http", "dep:hyper", "dep:reqwest", "dep:url", "dep:urlencoding"]
//! aws = ["awss3", "awssts", "dep:aws-config", "dep:aws-types"]
//! awss3 = ["dep:aws-sdk-s3", "dep:aws-config", "dep:aws-types"]
//! awssts = ["dep:aws-sdk-sts", "dep:aws-config", "dep:aws-types"]
//! diesel = ["dep:diesel", "dep:deadpool", "dep:deadpool-diesel", "dep:diesel_migrations"]
//! redis = ["dep:redis", "dep:bb8", "dep:bb8-redis", "dep:moka"]
//! crypto = ["dep:argon2", "dep:hmac", "dep:ring", "dep:sha2"]
//! sms = [] # If HTTP is needed, enable together with "web"
//! full = ["web", "aws", "awss3", "awssts", "diesel", "redis", "crypto", "sms"]
//!
//! [dependencies]
//! # Mark related dependencies as optional
//! axum = { version = "0.8", features = ["macros"], optional = true }
//! tower = { version = "0.5", optional = true }
//! tower-http = { version = "0.6", optional = true }
//! hyper = { version = "1.6", features = ["full"], optional = true }
//! reqwest = { version = "0.12", features = ["gzip", "json"], optional = true }
//! url = { version = "2.5.4", optional = true }
//! urlencoding = { version = "2.1.3", optional = true }
//!
//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"], optional = true }
//! aws-sdk-s3 = { version = "1.83.0", optional = true }
//! aws-sdk-sts = { version = "1.66.0", optional = true }
//! aws-types = { version = "1.3.7", optional = true }
//!
//! diesel = { version = "2", features = ["chrono", "serde_json"], optional = true }
//! deadpool = { version = "0.12", optional = true }
//! deadpool-diesel = { version = "0.6", features = ["postgres"], optional = true }
//! diesel_migrations = { version = "2", optional = true }
//!
//! redis = { version = "0.32", optional = true }
//! bb8 = { version = "0.9", optional = true }
//! bb8-redis = { version = "0.24", optional = true }
//! moka = { version = "0.12", features = ["future"], optional = true }
//!
//! argon2 = { version = "0.5", optional = true }
//! hmac = { version = "0.12", optional = true }
//! sha2 = { version = "0.10", optional = true }
//! ring = { version = "0.17.14", optional = true }
//! ```
//!
//! The above is only an example; align versions with your actual dependencies.
// =========================
// Core re-exports (always)
// =========================
pub use anyhow;
pub use async_trait;
pub use base64;
pub use bon;
pub use chrono;
pub use dashmap;
pub use hex;
pub use indexmap;
pub use lazy_static;
pub use log;
pub use md5;
pub use once_cell;
pub use rand;
pub use regex;
pub use schemars;
pub use serde;
pub use serde_json;
pub use thiserror;
pub use tokio;
pub use tracing;
pub use uuid;
pub use validator;
// Image processing (always available as dependencies are not optional)
pub use image;
pub use imageproc;
// =========================
// Web re-exports (feature)
// =========================
pub use axum;
pub use hyper;
pub use reqwest;
pub use tower;
pub use tower_http;
pub use url;
pub use urlencoding;
// =========================
// AWS re-exports (feature)
// =========================
// Shared AWS config/types are available under any AWS sub-feature or aws/full
pub use aws_config;
pub use aws_types;
// S3 is available only under awss3 or aws/full
pub use aws_sdk_s3;
// STS is available only under awssts or aws/full
pub use aws_sdk_sts;
// =============================
// Database diesel re-exports (feature)
// =============================
pub use deadpool;
pub use deadpool_diesel;
pub use diesel;
pub use diesel_migrations;
// ==========================
// Database sqlx re-exports (feature)
// ==========================
pub use sqlx;
// =========================
// Redis re-exports (feature)
// =========================
pub use bb8;
pub use bb8_redis;
pub use moka;
pub use redis;
// ==========================
// Crypto re-exports (feature)
// ==========================
pub use argon2;
pub use hmac;
pub use ring;
pub use sha2;
// ==================
// Module declarations
// ==================
// Core and common modules (always available)
// Web modules
// AWS
// Database
// Redis
// Crypto
// SMS (if it depends on HTTP/network requests, enable together with "web")
// Captcha (requires web and redis features for full functionality)