#![allow(unused_imports)]
use super::*;
pub struct ArcBiFunction<T, U, R> {
pub(super) function: Arc<dyn Fn(&T, &U) -> R + Send + Sync>,
pub(super) name: Option<String>,
}
impl<T, U, R> ArcBiFunction<T, U, R> {
impl_function_common_methods!(
ArcBiFunction<T, U, R>,
(Fn(&T, &U) -> R + Send + Sync + 'static),
|f| Arc::new(f)
);
impl_shared_function_methods!(
ArcBiFunction<T, U, R>,
ArcConditionalBiFunction,
into_arc,
Function,
Send + Sync + 'static
);
}
impl_function_constant_method!(ArcBiFunction<T, U, R>, Send + Sync + 'static);
impl_function_debug_display!(ArcBiFunction<T, U, R>);
impl_function_clone!(ArcBiFunction<T, U, R>);
impl<T, U, R> BiFunction<T, U, R> for ArcBiFunction<T, U, R> {
fn apply(&self, first: &T, second: &U) -> R {
(self.function)(first, second)
}
impl_arc_conversions!(
ArcBiFunction<T, U, R>,
BoxBiFunction,
RcBiFunction,
BoxBiFunctionOnce,
Fn(t: &T, u: &U) -> R
);
}
impl_closure_trait!(
BiFunction<T, U, R>,
apply,
BoxBiFunctionOnce,
Fn(first: &T, second: &U) -> R
);