macro_rules! NewtypeComponentId {
    (
        ()
        $vis:vis struct $name:ident $($token:tt)*
    ) => { ... };
}
Expand description

Macro attribute for deriving ComponentId trait.

Accepts input in any of following forms:

()
$vis:vis struct $name:ident (
    $(#[$id_attr:meta])* $(pub)? $id:ty
    $(, $(#[$phantom_attr:meta])* $(pub)? $phantom:ty)* $(,)?
);
()
$vis:vis struct $name:ident <$generics> (
    $(#[$id_attr:meta])* $(pub)? $id:ty
    $(, $(#[$phantom_attr:meta])* $(pub)? $phantom:ty)* $(,)?
) $(where $where_clause)?;

Examples

use components_arena::{Component, Id, NewtypeComponentId};
use phantom_type::PhantomType;

macro_attr! {
    #[derive(Educe, NewtypeComponentId!)]
    #[educe(Debug, Copy, Clone, Eq, PartialEq, Hash, Ord, PartialOrd)]
    pub struct Item<Tag, X>(Id<ItemNode<Tag>>, PhantomType<X>);
}