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
/*******************************************************************************
*
* Copyright (c) 2025 - 2026.
* Haixing Hu, Qubit Co. Ltd.
*
* All rights reserved.
*
******************************************************************************/
//! Defines the `BoxBinaryFunction` public type.
use *;
// ============================================================================
// Type Aliases for BinaryOperator (BiFunction<T, T, R>)
// ============================================================================
/// Type alias for `BoxBiFunction<T, T, R>`
///
/// Represents a binary function that takes two values of type `T` and produces
/// a value of type `R`, with single ownership semantics. Similar to Java's
/// `BiFunction<T, T, R>` but with different type parameters.
///
/// # Examples
///
/// ```rust
/// use qubit_function::{BoxBinaryFunction, BiFunction};
///
/// let add: BoxBinaryFunction<i32, i32> = BoxBinaryFunction::new(|x, y| *x + *y);
/// assert_eq!(add.apply(&20, &22), 42);
/// ```
///
/// # Author
///
/// Haixing Hu
pub type BoxBinaryFunction<T, R> = ;