blob: 76ae96757c529a6661e9b8d1cc6327620f6c53c0 [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
David Tolnaydaaf7742016-10-03 11:11:43 -070013 fn invoke(self, arg: A) -> A {
14 arg
15 }
David Tolnay55337722016-09-11 12:58:56 -070016}