I have a struct
struct A<F: Fn(i32)->i32>
How to define function which return it like
fn some_function() -> A<Fn(i32)->i32>
?
I have a struct
struct A<F: Fn(i32)->i32>
How to define function which return it like
fn some_function() -> A<Fn(i32)->i32>
?
I think you need to use the
fntype instead of theFntrait:You can of course also use the
Fntrait, but then you need to use theimplkeyword:implhere means "this is a type that I don't want to write here completely, but believe me, it implementsFn(i32) -> i32".