Macro abi_stable::impl_get_type_info[][src]

macro_rules! impl_get_type_info {
    ($type : ty) => { ... };
}
Expand description

Constructs the TypeInfo for some type.

It’s necessary for the type to be 'static because TypeInfo stores a private function that returns the UTypeId of that type.

Example

use abi_stable::{
    impl_get_type_info,
    erased_types::{TypeInfo,ImplType},
};

#[derive(Default, Clone, Debug)]
struct Foo<T> {
    l: u32,
    r: u32,
    name: T,
}

impl<T> ImplType for Foo<T>
where T: 'static + Send + Sync
{
    type Interface = ();

    const INFO: &'static TypeInfo = impl_get_type_info! {Self};
}