Passing closure to trait method: expected type parameter, found closure
问题 I'm a bit stumped on how to get this working, I've cut it down from the real thing. I wrote a trait: pub trait Renderable<F: Fn(&PropertyTags)> { fn set_property_changed_callback(&mut self, callback: Option<F>); } Which the 'child' parameter of add_child is restricted by and PropertyTags is just an enum. I've included mock implementations of the type of child to demonstrate my usage: pub struct Child<F: Fn(&PropertyTags)> { property_changed_callback: Option<F>, } impl<F: Fn(&PropertyTags)>