parity_wasm/builder/invoke.rs
1//! invoke helper
2
3/// Helper trait to allow chaining
4pub trait Invoke<A> {
5 type Result;
6
7 fn invoke(self, arg: A) -> Self::Result;
8}
9
10/// Identity chain element
11pub struct Identity;
12
13impl<A> Invoke<A> for Identity {
14 type Result = A;
15
16 fn invoke(self, arg: A) -> A {
17 arg
18 }
19}