Expand description
§BiConsumer Types
Provides non-mutating 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: it is invoked through &self and
receives shared references to both input values.
Suitable for pure observation, logging, and notification scenarios with two
parameters. Compared to StatefulBiConsumer, BiConsumer does not require
wrapper-level interior mutability (Mutex/RefCell), making it 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 non-mutating bi-consumer interface
- FnBi
Consumer Ops - Extension trait providing non-mutating bi-consumer composition methods for closures