use crate::macros::{
impl_box_once_conversions,
impl_closure_once_trait,
};
use crate::predicates::bi_predicate::{
BiPredicate,
BoxBiPredicate,
};
use crate::transformers::{
macros::{
impl_box_conditional_transformer,
impl_box_transformer_methods,
impl_conditional_transformer_debug_display,
impl_transformer_common_methods,
impl_transformer_constant_method,
impl_transformer_debug_display,
},
transformer_once::TransformerOnce,
};
mod box_bi_transformer_once;
pub use box_bi_transformer_once::BoxBiTransformerOnce;
mod fn_bi_transformer_once_ops;
pub use fn_bi_transformer_once_ops::FnBiTransformerOnceOps;
mod binary_operator_once;
pub use binary_operator_once::BinaryOperatorOnce;
mod box_binary_operator_once;
pub use box_binary_operator_once::BoxBinaryOperatorOnce;
mod box_conditional_bi_transformer_once;
pub use box_conditional_bi_transformer_once::BoxConditionalBiTransformerOnce;
pub trait BiTransformerOnce<T, U, R> {
fn apply(self, first: T, second: U) -> R;
fn into_box(self) -> BoxBiTransformerOnce<T, U, R>
where
Self: Sized + 'static,
{
BoxBiTransformerOnce::new(move |t: T, u: U| self.apply(t, u))
}
fn into_fn(self) -> impl FnOnce(T, U) -> R
where
Self: Sized + 'static,
{
move |t: T, u: U| self.apply(t, u)
}
fn to_box(&self) -> BoxBiTransformerOnce<T, U, R>
where
Self: Clone + 'static,
{
self.clone().into_box()
}
fn to_fn(&self) -> impl FnOnce(T, U) -> R
where
Self: Clone + 'static,
{
self.clone().into_fn()
}
}