Trait hytra::FnAcc[][src]

pub trait FnAcc<T> {
    fn call(&self, arg1: T, arg2: T) -> T;
}

This is workaround for the fact that the Fn trait is not stable. We could have TrAcc<T, F: Fn(T, T) -> T>. However, since the Fn trait is not stable, this would not allow to have TrAcc for an accumulator other than a closure (which makes the type un-namable) or a function pointer (which means dynamic dispatch). The FnAcc is a custom trait that we use as a purpose-specific variant of Fn(T, T) -> T.

Required methods

fn call(&self, arg1: T, arg2: T) -> T[src]

Call the function.

Loading content...

Implementors

impl<T, U: Fn(T, T) -> T> FnAcc<T> for U[src]

Loading content...