use forward_traits::{forwardable, forward_receiver, forward_traits}; #[forwardable] trait Foo { fn foo (&self, x: A, y: B) -> Option ; } struct Delegated { } impl Foo for Delegated { fn foo (&self, x: u32, y: u32) -> Option { Some (x + y) } } #[forward_receiver] struct Receiver { d: Delegated } forward_traits! (for Receiver . d impl Foo ); fn main () { assert_eq! (Receiver {d: Delegated {}} . foo (1, 2), Some (3)); }