summaryrefslogtreecommitdiffstats
path: root/third_party/rust/parity-wasm/src/builder/invoke.rs
blob: 1dd6598d0d0e2e26531ebbe07d13849b37eb9af8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! invoke helper

/// Helper trait to allow chaining
pub trait Invoke<A> {
	type Result;

	fn invoke(self, arg: A) -> Self::Result;
}

/// Identity chain element
pub struct Identity;

impl<A> Invoke<A> for Identity {
	type Result = A;

	fn invoke(self, arg: A) -> A { arg }
}