Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait MyTrait<I, O> {
- type MyType;
- fn my_method(&self);
- }
- impl<F, I, O> MyTrait<I, O> for F
- where
- F: Fn(I) -> O,
- {
- type MyType = F::Output;
- fn my_method(&self) {
- println!("hello my_method");
- }
- }
- fn main() {
- (|_: &str| {4}).my_method();
- }
Add Comment
Please, Sign In to add comment