Skip to main content

impl_typed_external

Macro impl_typed_external 

Source
impl_typed_external!() { /* proc-macro */ }
Expand description

Generate TypedExternal and IntoExternalPtr impls for a concrete monomorphization of a generic type.

Since #[derive(ExternalPtr)] rejects generic types, use this macro to generate the necessary impls for a specific type instantiation.

§Example

struct Wrapper<T> { inner: T }

impl_typed_external!(Wrapper<i32>);
impl_typed_external!(Wrapper<String>);