delegate

Macro delegate 

Source
macro_rules! delegate {
    ($base_trait:ty, fn $name:ident (&self, $($pname:ident: $ptype:ty),*) -> $rtype:ty) => { ... };
    ($base_trait:ty, fn $name:ident (&self) -> $rtype:ty) => { ... };
}
Expand description

Used to easily implement functions in the trait definition of RingStore and its subtraits to delegate the call to the same function of the underlying RingBase.

§Example

 
trait WeirdRingBase: RingBase {
    fn foo(&self) -> Self::Element;
}
 
trait WeirdRingStore: RingStore
    where Self::Type: WeirdRingBase
{
    delegate!{ WeirdRingBase, fn foo(&self) -> El<Self> }
}

§Limitations

This macro does not work if the function takes generic parameters. In this case, write the delegation manually.