concision_neural/traits/activate.rs
1pub trait BinaryAction<A, B = A> {
2 type Output;
3
4 fn activate(lhs: A, rhs: B) -> Self::Output;
5}
6
7pub trait Activate<Rhs = Self> {
8 type Output;
9
10 fn activate(&self, rhs: Rhs) -> Self::Output;
11}
12
13impl<X, Y, F> Activate<X> for F
14where
15 F: Fn(X) -> Y,
16{
17 type Output = Y;
18
19 fn activate(&self, rhs: X) -> Self::Output {
20 self(rhs)
21 }
22}