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
//! # Cyrup Sugars
//!
//! Syntactic sugar utilities for Rust - collections, async patterns, and macros.
//!
//! This crate provides ergonomic utilities organized into feature-gated modules:
//!
//! ## Features
//!
//! - `collections` - Enhanced collection types like `ZeroOneOrMany`, `OneOrMany`, and `ByteSize`
//! - `async` - Async utilities with the "always unwrapped" pattern using `AsyncTask` and `AsyncStream`
//! - `macros` - Convenient macros for collections and async operations
//! - `array-tuples` - 🔥 Amazing hashbrown HashMap macros with array tuple syntax support
//! - `gix-interop` - Git object ID optimized hash tables
//!
//! ## Example
//!
//! ```rust
//! use cyrup_sugars::collections::ByteSizeExt;
//! use cyrup_sugars::{AsyncTask, AsyncResult};
//!
//! // Ergonomic byte sizes
//! let cache_size = 512.mb();
//! println!("Cache size: {} bytes", cache_size.as_bytes());
//!
//! // Type-safe async operations (no raw Results allowed)
//! let task = AsyncTask::from_value(42);
//! // let bad_task = AsyncTask::from_value(Ok(42)); // Compile error!
//! ```
//!
//! ### 🔥 Hashbrown Array Tuple Syntax (with `array-tuples` feature)
//!
//! ```ignore
//! use cyrup_sugars::collections::{ZeroOneOrMany, OneOrMany};
//! use cyrup_sugars::macros::hashbrown::hash_map;
//! use serde_json;
//!
//! // Semantic JSON mapping with blazing fast hashbrown
//! let config = hash_map! {
//! "servers" => ZeroOneOrMany::many(vec!["api.com", "db.com"]),
//! "endpoints" => OneOrMany::one("primary.api.com")
//! };
//! let json = serde_json::to_string_pretty(&config)?;
//!
//! // Flexible deserialization - handles null, single values, or arrays
//! let from_null: ZeroOneOrMany<String> = serde_json::from_str("null")?;
//! let from_single: ZeroOneOrMany<String> = serde_json::from_str(r#""hello""#)?;
//! let from_array: ZeroOneOrMany<String> = serde_json::from_str(r#"["hello", "world"]"#)?;
//! ```
/// Closure macros for elegant stream processing with zero-allocation pattern matching
// Re-export modules from workspace packages
pub use sugars_collections as collections;
/// Async utilities with the "always unwrapped" pattern.
///
/// This module provides `AsyncTask` and `AsyncStream` types that enforce
/// proper error handling at the type level, preventing raw `Result` types
/// from being wrapped in async primitives.
pub use sugars_macros as macros;
pub use sugars_builders as builders;
// Re-export commonly used types from collections
pub use ;
// Re-export array tuple extension traits when both features are enabled
pub use ;
// Re-export async utilities
pub use r#;
// Re-export JSON syntax macros for array-tuples feature
pub use hash_map;
pub use hash_map_fn;
/// Prelude module that brings common macros and types into scope