Module readonly_bi_consumer

Module readonly_bi_consumer 

Source
Expand description

§ReadonlyBiConsumer Types

Provides readonly bi-consumer interface implementations for operations that accept two input parameters without modifying their own state or the input values.

This module provides a unified ReadonlyBiConsumer trait and three concrete implementations based on different ownership models:

  • BoxReadonlyBiConsumer<T, U>: Box-based single ownership
  • ArcReadonlyBiConsumer<T, U>: Arc-based thread-safe shared ownership
  • RcReadonlyBiConsumer<T, U>: Rc-based single-threaded shared ownership

§Design Philosophy

ReadonlyBiConsumer 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, ReadonlyBiConsumer does not require interior mutability (Mutex/RefCell), thus more efficient and easier to share.

§Author

Haixing Hu

Structs§

ArcReadonlyBiConsumer
ArcReadonlyBiConsumer struct
BoxReadonlyBiConsumer
BoxReadonlyBiConsumer struct
RcReadonlyBiConsumer
RcReadonlyBiConsumer struct

Traits§

FnReadonlyBiConsumerOps
Extension trait providing readonly bi-consumer composition methods for closures
ReadonlyBiConsumer
ReadonlyBiConsumer trait - Unified readonly bi-consumer interface