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
/*!
# Lodash-RS: High-Performance Rust Collection Library
A type-safe, high-performance Rust implementation of Lodash collection methods with zero-cost abstractions.
## Features
- **100% API Compatible**: Complete compatibility with Lodash collection methods
- **Type Safe**: Leverages Rust's type system for compile-time safety
- **Zero-Cost Abstractions**: No runtime overhead compared to hand-written code
- **Chainable**: Support for fluent method chaining
- **Async Support**: Built-in async/await support for all operations
- **Parallel Processing**: Automatic parallelization for large collections
- **Memory Safe**: Guaranteed memory safety with no data races
- **WASM Compatible**: Full WebAssembly support for browser usage
## Quick Start
```rust
use rust_lodash::prelude::*;
// Basic usage
let doubled = map(&[1, 2, 3, 4], |x| x * 2);
assert_eq!(doubled, vec![2, 4, 6, 8]);
// Chainable operations
let result = chain(&[1, 2, 3, 4, 5])
.filter(|x| x % 2 == 0)
.map(|x| x * 3)
.collect();
assert_eq!(result, vec![6, 12]);
// Async operations (requires async feature)
// let async_result = map_async(&[1, 2, 3], |x| async move { x * 2 }).await;
// assert_eq!(async_result, vec![2, 4, 6]);
```
## Architecture
The library is organized into several modules:
- `collection`: Core collection methods (iteration, query, transform, operations)
- `chain`: Fluent method chaining system
- `utils`: Utility functions and type conversions
- `extensions`: Advanced features (parallel processing, WASM support)
## Performance
Lodash-RS is designed for maximum performance:
- **SIMD Optimizations**: Automatic vectorization for numeric operations
- **Parallel Processing**: Multi-threaded execution for large datasets
- **Zero-Copy Operations**: Minimal memory allocation and copying
- **Cache-Friendly**: Optimized memory layout for better cache performance
## Safety
- **Memory Safe**: No buffer overflows, use-after-free, or data races
- **Type Safe**: Compile-time type checking prevents runtime errors
- **Panic-Free**: All operations handle edge cases gracefully
- **Error Handling**: Comprehensive error types with proper propagation
*/
// #![cfg_attr(not(feature = "std"), no_std)]
// Core modules
// Re-exports for convenience
// Version information
/// The version of the rust-lodash crate.
pub const VERSION: &str = env!;
// Feature detection
pub const HAS_ASYNC: bool = true;
/// Whether async features are enabled.
pub const HAS_ASYNC: bool = false;
pub const HAS_PARALLEL: bool = true;
/// Whether parallel processing features are enabled.
pub const HAS_PARALLEL: bool = false;
pub const HAS_WASM: bool = true;
/// Whether WebAssembly features are enabled.
pub const HAS_WASM: bool = false;