Macro pavo_traits::impl_as_ptr[][src]

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

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

Examples

use pavo_traits::{impl_as_ref, impl_as_ptr, AsPtr};

struct Bar {}
struct Foo {
    inner: Bar,
}

impl_as_ref!(Foo);
impl_as_ref!(Foo, Bar, inner);
impl_as_ptr!(Foo);
impl_as_ptr!(Foo, Bar);