ArcBinaryFunction

Type Alias ArcBinaryFunction 

Source
pub type ArcBinaryFunction<T, R> = ArcBiFunction<T, T, R>;
Expand description

Type alias for ArcBiFunction<T, T, R>

Represents a thread-safe binary function that takes two values of type T and produces a value of type R. Similar to Java’s BiFunction<T, T, R> with shared, thread-safe ownership.

§Examples

use prism3_function::{ArcBinaryFunction, BiFunction};

let multiply: ArcBinaryFunction<i32, i32> = ArcBinaryFunction::new(|x, y| *x * *y);
let multiply_clone = multiply.clone();
assert_eq!(multiply.apply(&6, &7), 42);
assert_eq!(multiply_clone.apply(&6, &7), 42);

§Author

Haixing Hu

Aliased Type§

pub struct ArcBinaryFunction<T, R> { /* private fields */ }