callable 0.5.0

callable closures implementing PartialEq and argument operations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::IsCallable;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct AcceptAnything<Cbk: super::Callable<()>>(pub(crate) Cbk);

impl<Cbk: super::Callable<()>> IsCallable for AcceptAnything<Cbk> {}

impl<Cbk: super::Callable<()>, IN> super::Callable<(IN,)> for AcceptAnything<Cbk> {
    type Output = Cbk::Output;

    fn call_fn(&self, _: (IN,)) -> Self::Output {
        self.0.call_fn(())
    }
}