delegable-derive
Experimental proc macro to delegate the implementation of some traits to a field or function.
Requires nightly.
Usage
See the companion test repository.
Examples
See the examples directory, that contains the following examples:
my_into
: a delegable implementation of anInto
-like trait. Demonstrates that the macro works with names that are overloaded likeinto()
(also, generic parameter).vec_facade
: a delegable trait that implements the inherent methods ofVec
. It is easy to have a "vector-like" struct by implementing the delegate trait for theVecFacade
trait.