Ralith / hecs

A handy ECS
Apache License 2.0
921 stars 79 forks source link

!Sync + !Send Component #353

Closed Umenokin closed 7 months ago

Umenokin commented 8 months ago

Hi folks

It seems from version 0.16 WGPU on the web is !Sync + !Send while hecs Component is an alias for Sync + Send. In such a case how can someone create a component having !Sync + !Send properties. It is rather Rust newbie question I guess 😅

Ralith commented 8 months ago

Typically you'd store those in a table in the side (perhaps a HashMap or Slab) and only store indexes into that table in the ECS. Alternatively, you could use something like SendWrapper.

Umenokin commented 7 months ago

Thank you, @Ralith !