mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-06-29 06:32:17 +00:00
17 lines
276 B
Rust
17 lines
276 B
Rust
//! 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 }
|
|
} |