Skip to main content

impl_type

Macro impl_type 

Source
macro_rules! impl_type {
    ($ty:ty => $variant:expr) => { ... };
    ($($ty:ty),+ => $variant:expr) => { ... };
}
Expand description

Implements the Type trait for multiple types mapping to the same IDL type.

This macro simplifies bulk implementation of the Type trait for groups of types that share the same IDL representation.

§Examples

// Single type
impl_type!(bool => idl::Type::Bool);

// Multiple types with the same mapping
impl_type!(i8, i16, i32, i64 => idl::Type::Int);

// Feature-gated implementations
#[cfg(feature = "std")]
impl_type!(String => idl::Type::String);