blob: cf799e2acb34856bae1170d6826e8e4cf3300ff9 [file] [log] [blame]
David Tolnay55337722016-09-11 12:58:56 -07001pub trait Invoke<A> {
2 type Result;
3
4 fn invoke(self, arg: A) -> Self::Result;
5}
6
7#[derive(Copy, Clone)]
8pub struct Identity;
9
10impl<A> Invoke<A> for Identity {
11 type Result = A;
12
13 fn invoke(self, arg: A) -> A { arg }
14}