BoxBinaryFunction

Type Alias BoxBinaryFunction 

Source
pub type BoxBinaryFunction<T, R> = BoxBiFunction<T, T, R>;
Expand description

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

use prism3_function::{BoxBinaryFunction, BiFunction};

let add: BoxBinaryFunction<i32, i32> = BoxBinaryFunction::new(|x, y| *x + *y);
assert_eq!(add.apply(&20, &22), 42);

§Author

Haixing Hu

Aliased Type§

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