Derive_delegate: The generic derive macro for all traits
Portrait v0.3.0 introduces the derive_delegate derive filler, which derives trait implementations by delegating trait calls to all fields of a struct/enum. Unlike manually written derive macros that only support one specific trait , derive_delegate works for any trait with a #[portrait::make] attribute. The behavior of derive_delegate is similar to many macros from the standard library. Here is an all-in-one example that compiles: #[portrait::make] trait Foo { fn new(arg1: i32, arg2: &str,...
The Rust Programming Language Forum