Files
parity-wasm/src/builder/invoke.rs

17 lines
276 B
Rust
Raw Normal View History

2017-04-06 11:34:31 +03:00
//! invoke helper
2018-01-09 12:23:42 +03:00
/// Helper trait to allow chaining
2017-04-06 11:34:31 +03:00
pub trait Invoke<A> {
type Result;
fn invoke(self, arg: A) -> Self::Result;
}
2018-01-09 12:23:42 +03:00
/// Identity chain element
2017-04-06 11:34:31 +03:00
pub struct Identity;
impl<A> Invoke<A> for Identity {
type Result = A;
fn invoke(self, arg: A) -> A { arg }
}