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
//! # Hamon (刃文) - Zero-Cost Static Decorators
//!
//! A high-performance library that enables composing data processing pipelines
//! resolved entirely at compile time through Rust's type system.
//!
//! ## Philosophy
//! Traditional decorator patterns sacrifice performance for modularity through
//! dynamic dispatch. Hamon achieves both by leveraging monomorphization -
//! the compiler generates specialized machine code for each pipeline,
//! eliminating indirection while preserving clean, composable APIs.
//!
//! ## Performance Advantages
//! - **Compile Time**: Generic recursion builds type-level pipeline structure
//! - **Runtime**: Direct function calls with zero abstraction overhead
//! - **Memory**: Stack-first design avoids heap fragmentation
//!
//! ## Primary Model
//! The `Decorator<T, O>` trait represents a fallible transformation edge in the pipeline.
//! Through recursive generics, complex chains become nested types that LLVM
//! can optimize into flat, efficient assembly.
//!
//! It's noteworthy the crate relies on the lazy computation which also means that any operations are stacked up
//! until it's consumed by the caller. The flexibility this model equips you with deferred logic processing requests so as to
//! the latter emergence can augment the former computations by discarding unnecessary steps.
//!
//! ### Common Usage
//! Delve into practice, when the output requires a trivial steps of transformation (pipeline)
//! given each is considered distinct. In that case, each should define a respective logic for its own flavor
//! then add up to the final outcome.
pub use AllowStep;
/// A trait for types that can transform an input `T` into an output `O`.
///
/// In the Hamon philosophy, this is the 'Edge'—the logic that defines
/// how data is tempered as it passes through the pipeline.
/// This trait imposes the standard behavior which Steps should follow.
///
/// Upon invoking, it would trigger the collection by processing any piled up Decorator.