use fast_delegate::{delegate, Delegate}; #[delegate] pub trait Delegate { fn do_something(&mut self); } #[derive(Delegate)] pub struct Delegated { #[to(Delegate)] a: MyStruct, } pub struct MyStruct; impl Delegate for MyStruct { fn do_something(&mut self) { println!("HI"); } }