Expand description
§BiConsumer Types
Provides readonly bi-consumer interface implementations for operations that accept two input parameters without modifying their own state or the input values.
It is similar to the Fn(&T, &U) trait in the standard library.
This module provides a unified BiConsumer trait and three
concrete implementations based on different ownership models:
BoxBiConsumer<T, U>: Box-based single ownershipArcBiConsumer<T, U>: Arc-based thread-safe shared ownershipRcBiConsumer<T, U>: Rc-based single-threaded shared ownership
§Design Philosophy
BiConsumer uses Fn(&T, &U) semantics: neither modifies its
own state nor the input values.
Suitable for pure observation, logging, and notification scenarios with two parameters. Compared to BiConsumer, BiConsumer does not require interior mutability (Mutex/RefCell), thus more efficient and easier to share.
§Author
Haixing Hu
Structs§
- ArcBi
Consumer - ArcBiConsumer struct
- ArcConditional
BiConsumer - ArcConditionalBiConsumer struct
- BoxBi
Consumer - BoxBiConsumer struct
- BoxConditional
BiConsumer - BoxConditionalBiConsumer struct
- RcBi
Consumer - RcBiConsumer struct
- RcConditional
BiConsumer - RcConditionalBiConsumer struct
Traits§
- BiConsumer
- BiConsumer trait - Unified readonly bi-consumer interface
- FnBi
Consumer Ops - Extension trait providing readonly bi-consumer composition methods for closures