!Send
and !Sync
Components
World
can store !Send
and/or !Sync
components once the thread_local
feature is set but they come with limitations:
!Send
storages can only be added inWorld
's thread.Send + !Sync
components can only be accessed from one thread at a time.!Send + Sync
components can only be accessed immutably from other threads.!Send + !Sync
components can only be accessed in the thread they were added in.
These storages are accessed with NonSend
, NonSync
and NonSendSync
, for example:
fn run(rcs_usize: NonSendSync<View<Rc<usize>>>, rc_u32: NonSendSync<UniqueView<Rc<u32>>>) {}