An attribute-like macro to implement traits for Either
. If your trait is implemented for both type A
and B
, then it is automatically implemented for Either<A, B>
.
Usage
When defining a trait, add the attribute #[either_trait]
.
Example
use Either;
use either_trait;
/// Apply a function `n` times.
Limitations
This macro only supports traits without any associated constant or associated type. Generic type parameters of the trait must not be L
or R
. The first parameter of a trait method must be self
, &self
or &mut self
. The types of other parameters and the return type must not contain Self
.