use std::marker::PhantomData;
#[derive(Clone)]
pub struct WithCall<F, T>
where
T: Clone,
{
fp: F,
r_type: PhantomData<T>, }
impl<F, T> WithCall<F, T>
where
F: Fn(&T, Vec<Option<&T>>) -> T,
T: Clone,
{
pub fn new(fp: F) -> Self {
WithCall {
fp,
r_type: PhantomData,
}
}
pub fn run(&self, a: &T, b: Vec<Option<&T>>) -> T {
(self.fp)(a, b)
}
}