Attribute Macro diplomat::transparent_convert

source ·
#[transparent_convert]
Expand description

Generate conversions from inner types for opaque Diplomat types with a single field

This is invoked as #[diplomat::transparent_convert] on an opaque Diplomat type. It will add #[repr(transparent)] and implement pub(crate) fn transparent_convert() which allows constructing an &Self from a reference to the inner field.