ArcUnaryOperator

Type Alias ArcUnaryOperator 

Source
pub type ArcUnaryOperator<T> = ArcTransformer<T, T>;
Expand description

Type alias for ArcTransformer<T, T>

Represents a thread-safe unary operator that transforms a value of type T to another value of the same type T. Equivalent to Java’s UnaryOperator<T> with shared, thread-safe ownership.

§Examples

use prism3_function::{ArcUnaryOperator, Transformer};

let double: ArcUnaryOperator<i32> = ArcUnaryOperator::new(|x| x * 2);
let double_clone = double.clone();
assert_eq!(double.apply(21), 42);
assert_eq!(double_clone.apply(21), 42);

§Author

Hu Haixing

Aliased Type§

pub struct ArcUnaryOperator<T> { /* private fields */ }