Say I have a function of:
fn blah<Type, Ret, F>(cb: F) -> Ret
where
F: FnOnce(&mut Big<Complicated, Noisy<Type>>) -> Ret, {...}
I can call it like blah(|t: &mut Big<Complicated, Noisy<Type>>| ...)
, but that's a whole lot to type out at a whole lot of call sites.
Is there any way I could call it like blah::<AType>(|t| ...)
somehow instead? Currently this is causing E0107 because not all the generic type arguments are defined, and I could easily define Type
and Ret
, but F
is untypeable (as far as I know) as it's a closure. This example is distilled down to a simple one that still demonstrates the issue.
This code demonstrates the issue but it doesn't show the complexity of the type that would have to be typed in every closure (it's a rather long type...), this is just a minimized example:
I do apologize if I missed an obvious thread here but I attempted searching to no avail, I might be missing some vital keywords to add to the search. Links would be amazing!