pavo_traits
macro_rules! impl_as_ptr { ($Type:ty) => { ... }; ($Type:ty, $Target:ty) => { ... }; ($Type:ty, $Target:ty, $Expr:tt) => { ... }; }
用于帮助实现 AsPtr 契定的宏。
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);