Expand description
§Consumer Types
Provides implementations of consumer interfaces for executing operations that accept a single input parameter but return no result.
This module provides a unified Consumer trait and three concrete
implementations based on different ownership models:
BoxConsumer<T>: Box-based single ownership implementation for one-time use scenariosArcConsumer<T>: Thread-safe shared ownership implementation based on Arc<Mutex<>>RcConsumer<T>: Single-threaded shared ownership implementation based on Rc<RefCell<>>
§Design Philosophy
Consumer uses FnMut(&T) semantics, allowing modification of its own state
but not the input value. Suitable for statistics, accumulation, event
handling, and other scenarios.
§Author
Hu Haixing
Structs§
- ArcConditional
Consumer - ArcConditionalConsumer struct
- ArcConsumer
- ArcConsumer struct
- BoxConditional
Consumer - BoxConditionalConsumer struct
- BoxConsumer
- BoxConsumer struct
- RcConditional
Consumer - RcConditionalConsumer struct
- RcConsumer
- RcConsumer struct
Traits§
- Consumer
- Consumer trait - Unified consumer interface
- FnConsumer
Ops - Extension trait providing consumer composition methods for closures