MagicArgs

Trait MagicArgs 

Source
pub trait MagicArgs {
    // Required method
    fn apply<C, T>(self, f: C) -> C::Output
       where C: Callable<Self, T>,
             Self: Sized;
}
Expand description

A convinience trait to provide the args.apply(f) syntax.

Required Methods§

Source

fn apply<C, T>(self, f: C) -> C::Output
where C: Callable<Self, T>, Self: Sized,

Apply f on self.

Equivalent to: apply(f, self).

See: apply.

§Examples
fn f(x: i32) -> i32 { x + 1 }

let y = ("🦀", 41).apply(f);
assert_eq!(y, 42);

Implementors§

Source§

impl<U> MagicArgs for U