use std::marker::PhantomData;
#[derive(Debug, Clone, Copy)]
pub struct ErrTapStep<InputErr, OutputErr, TapFn>
where
TapFn: Fn(InputErr) -> OutputErr,
{
tap: TapFn,
_phantom: PhantomData<(InputErr, OutputErr)>,
}
impl<InputErr, OutputErr, TapFn> ErrTapStep<InputErr, OutputErr, TapFn>
where
TapFn: Fn(InputErr) -> OutputErr,
{
pub const fn new(func: TapFn) -> Self {
Self {
tap: func,
_phantom: PhantomData,
}
}
pub(crate) fn apply(&self, input_err: InputErr) -> OutputErr {
(self.tap)(input_err)
}
}