delegatemethod-rs
Delegate method calls to a field.
Examples
Suppose you have a struct called Inner
, with methods fn1
and fn2
.
You have another struct called Outer
with fields using Inner
as type.
You can use delegate_method
to forward some method implementations to the fields.
Acknowledgements
- The idea comes from Tommy McGuire's blog, but adjusted to match the Rust syntax better.