impl_borrow_variants

Macro impl_borrow_variants 

Source
macro_rules! impl_borrow_variants {
    ($target:ty, $trait:ident, $fn_name:ident, $op:tt, $($gen:ident: $gen_ty:ident),*) => { ... };
    ($lhs:ty, $trait:ident, $fn_name:ident, $op:tt, $rhs:ty, $($gen:ident: $gen_ty:ident),*) => { ... };
    ($lhs:ty, $trait:ident, $fn_name:ident, $op:tt, $rhs:ty, Output=$out_type:ty, $($gen:ident: $gen_ty:ident),*) => { ... };
}
Expand description

Given an implementation of an arithmetic trait on two borrowed references, this macro implements the same arithmetic on the owned and partially-owned variants