[][src]Macro pavo_traits::impl_as_ref

macro_rules! impl_as_ref {
    ($Type:ty) => { ... };
    ($Type:ty, $Target:ty) => { ... };
    ($Type:ty, $Target:ty, $Expr:tt) => { ... };
}

用于帮助实现 AsRef 契定的宏。

Examples

use pavo_traits::{impl_as_ref};

struct Bar {}

struct Foo {
    bar: Bar,
}

impl_as_ref!(Foo);
// Comment/Uncomment to select one of the follow lines.
// impl_as_ref!(Foo, Bar); // Exclusive with the bellow.
impl_as_ref!(Foo, Bar, bar); // Exclusive with the above.