Trait rin::ecs::component::OneToOneComponent[][src]

pub trait OneToOneComponent<'a>: 'static + Component + Deref<Target = Entity> { }

One to One components are just references to other entities where the reference must be unique.

It allows to have more than one component of the same type by using a reference.

Attempting to insert a non unique component will panic.

#[derive(OneToOneComponent, Debug, Hash)]
struct ComponentRef(Entity);

Automatically implements OneToOneComponent and can be used with ReadRef and Ref.

Implementors

Loading content...