Macro forward_ref_generic::forward_ref_unop
source · [−]macro_rules! forward_ref_unop {
(
$( [ $($generic:tt)* ] )?
impl Neg for $type:ty
$( where $($bound:tt)* )?
) => { ... };
(
$( [ $($generic:tt)* ] )?
impl $impl:ident, $meth:ident for $type:ty
$( where $($bound:tt)* )?
) => { ... };
}
Expand description
For a type T: Copy
which has unary operator unop
implemented, also implement unop &T
.
For readability, the expected syntax of the macro is the following:
( [ Generics ] )?
impl Trait, Method for Type
( where Bounds )?
Generics
are comma-seperated type or const genericsTrait
is the trait to be implementedMethod
is the method thatTrait
defines
(can be ommitted forNeg
)Type
is the type thatTrait
is implemented on (i.e.T
)Bounds
are comma-seperated trait bounds for the listed generics