Macro components_arena::NewtypeComponentId
source · [−]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 (
$(pub)? $id:ty $(, $(pub)? $phantom:ty)* $(,)?
);
ⓘ
()
$vis:vis struct $name:ident <$generics> (
$(pub)? $id:ty $(, $(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>);
}