@@ -83,7 +83,7 @@ In multi-server or p2p architecture [`IdRangeAllocator`] would need to communica
83
83
### Ergonomic entity types
84
84
85
85
Using ECS may lead to lots of ` .unwrap() ` calls or excessive error handling.
86
- There a lot of situations when entity is guaranteed to exist (for example it just returned from a view).
86
+ There are lots of situations when entity is guaranteed to exist (for example it just returned from a view).
87
87
To avoid handling [ ` NoSuchEntity ` ] error when it is unreachable, Edict provides [ ` AliveEntity ` ] trait that extends [ ` Entity ` ] trait.
88
88
Various methods require [ ` AliveEntity ` ] handle and skip existence check.
89
89
@@ -92,15 +92,15 @@ Various methods require [`AliveEntity`] handle and skip existence check.
92
92
[ ` EntityId ` ] implements only [ ` Entity ` ] as it doesn't provide any guaranties.
93
93
94
94
[ ` EntityBound ` ] is guaranteed to be alive, allowing using it in methods that doesn't handle entity absence.
95
- It keeps lifetime of [ ` World ` ] borrow, making it impossible to despawn any entity from the world.
96
- Using it with wrong [ ` World ` ] may cause panic.
97
- [ ` EntityBound ` ] can be acquire from relation queries.
95
+ It keeps lifetime of a [ ` World ` ] borrow, making it impossible to despawn any entity from the world.
96
+ * Using it with wrong [ ` World ` ] may cause panic* .
97
+ [ ` EntityBound ` ] can be acquired from relation queries.
98
98
99
- [ ` EntityLoc ` ] not only guarantees entity existence but also contains location of the entity in the archetypes,
100
- allowing to skip lookup step when accessing its components.
101
- Similarly to [ ` EntityBound ` ] , it keeps lifetime of [ ` World ` ] borrow, making it impossible to despawn any entity from the world.
102
- Using it with wrong [ ` World ` ] may cause panic.
103
- [ ` EntityLoc ` ] can be acquire from [ ` Entities ` ] query.
99
+ [ ` EntityLoc ` ] not only guarantees entity existence, but also contains location of the entity in the archetypes,
100
+ allowing functions to skip lookup step when accessing entity's components.
101
+ Similarly to [ ` EntityBound ` ] , it keeps lifetime of a [ ` World ` ] borrow, making it impossible to despawn any entity from the world.
102
+ * Using it with wrong [ ` World ` ] may cause panic* .
103
+ [ ` EntityLoc ` ] can be acquired from [ ` Entities ` ] query.
104
104
105
105
[ ` EntityRef ` ] is special.
106
106
It doesn't implement [ ` Entity ` ] or [ ` AliveEntity ` ] traits since it should not be used in world methods.
@@ -299,75 +299,79 @@ If "std" feature is not enabled error types will not implement [`std::error::Err
299
299
When "flow" feature is enabled and "std" is not, extern functions are used to implement TLS.
300
300
Application must provide implementation for these functions or linking will fail.
301
301
302
- When "scheduler" feature is enabled and "std" is not, external functions are used to implement thread parking.
303
- Application must provide implementation for these functions or linking will fail.
302
+ "scheduler" feature enables [ ` Scheduler ` ] type.
303
+ "threaded-scheduler" feature enables multithreaded execution for [ ` Scheduler ` ] , using [ ` Scheduler::run_with ` ] and [ ` Scheduler::run_threaded ` ] .
304
+ "rayon-scheduler" feature enables also rayon based execution for [ ` Scheduler ` ] using [ ` Scheduler::run_rayon ` ] .
304
305
305
306
[ `!Send` ] : https://doc.rust-lang.org/std/marker/trait.Send.html
306
307
[ `!Sized` ] : https://doc.rust-lang.org/std/marker/trait.Sized.html
307
308
[ `!Sync` ] : https://doc.rust-lang.org/std/marker/trait.Sync.html
308
- [ `ActionEncoder` ] : https://docs.rs/edict/1.0.0-rc4 /edict/action/struct.ActionEncoder.html
309
- [ `AliveEntity` ] : https://docs.rs/edict/1.0.0-rc4 /edict/entity/trait.AliveEntity.html
310
- [ `BorrowAll` ] : https://docs.rs/edict/1.0.0-rc4 /edict/query/struct.BorrowAll.html
311
- [ `BorrowAny` ] : https://docs.rs/edict/1.0.0-rc4 /edict/query/struct.BorrowAny.html
312
- [ `BorrowOne` ] : https://docs.rs/edict/1.0.0-rc4 /edict/query/struct.BorrowOne.html
313
- [ `Component` ] : https://docs.rs/edict/1.0.0-rc4 /edict/component/trait.Component.html
314
- [ `Component::on_drop` ] : https://docs.rs/edict/1.0.0-rc4 /edict/component/trait.Component.html#method.on_drop
315
- [ `Component::on_replace` ] : https://docs.rs/edict/1.0.0-rc4 /edict/component/trait.Component.html#method.on_replace
309
+ [ `ActionEncoder` ] : https://docs.rs/edict/1.0.0-rc6 /edict/action/struct.ActionEncoder.html
310
+ [ `AliveEntity` ] : https://docs.rs/edict/1.0.0-rc6 /edict/entity/trait.AliveEntity.html
311
+ [ `BorrowAll` ] : https://docs.rs/edict/1.0.0-rc6 /edict/query/struct.BorrowAll.html
312
+ [ `BorrowAny` ] : https://docs.rs/edict/1.0.0-rc6 /edict/query/struct.BorrowAny.html
313
+ [ `BorrowOne` ] : https://docs.rs/edict/1.0.0-rc6 /edict/query/struct.BorrowOne.html
314
+ [ `Component` ] : https://docs.rs/edict/1.0.0-rc6 /edict/component/trait.Component.html
315
+ [ `Component::on_drop` ] : https://docs.rs/edict/1.0.0-rc6 /edict/component/trait.Component.html#method.on_drop
316
+ [ `Component::on_replace` ] : https://docs.rs/edict/1.0.0-rc6 /edict/component/trait.Component.html#method.on_replace
316
317
[ `Context` ] : https://doc.rust-lang.org/std/task/struct.Context.html
317
- [ `Entities` ] : https://docs.rs/edict/1.0.0-rc4/edict/query/struct.Entities.html
318
- [ `Entity` ] : https://docs.rs/edict/1.0.0-rc4/edict/entity/trait.Entity.html
319
- [ `EntityBound` ] : https://docs.rs/edict/1.0.0-rc4/edict/entity/trait.EntityBound.html
320
- [ `EntityId` ] : https://docs.rs/edict/1.0.0-rc4/edict/entity/struct.EntityId.html
321
- [ `EntityLoc` ] : https://docs.rs/edict/1.0.0-rc4/edict/entity/struct.EntityLoc.html
322
- [ `EntityRef` ] : https://docs.rs/edict/1.0.0-rc4/edict/entity/struct.EntityRef.html
323
- [ `EntityRef::spawn_flow` ] : https://docs.rs/edict/1.0.0-rc4/edict/entity/struct.EntityRef.html#method.spawn_flow
324
- [ `flow` ] : https://docs.rs/edict/1.0.0-rc4/edict/flow/index.html
325
- [ `FlowEntity` ] : https://docs.rs/edict/1.0.0-rc4/edict/flow/struct.FlowEntity.html
326
- [ `FlowEntity::spawn_flow` ] : https://docs.rs/edict/1.0.0-rc4/edict/flow/struct.FlowEntity.html#method.spawn_flow
327
- [ `FlowEntity::wait_despawned` ] : https://docs.rs/edict/1.0.0-rc4/edict/flow/struct.FlowEntity.html#method.wait_despawned
328
- [ `FlowEntity::wait_has_component` ] : https://docs.rs/edict/1.0.0-rc4/edict/flow/struct.FlowEntity.html#method.wait_has_component
329
- [ `Flows` ] : https://docs.rs/edict/1.0.0-rc4/edict/flow/struct.Flows.html
330
- [ `Flows::execute` ] : https://docs.rs/edict/1.0.0-rc4/edict/flow/struct.Flows.html#method.execute
331
- [ `FlowWorld` ] : https://docs.rs/edict/1.0.0-rc4/edict/flow/struct.FlowWorld.html
332
- [ `FlowWorld::spawn_flow` ] : https://docs.rs/edict/1.0.0-rc4/edict/flow/struct.FlowWorld.html#method.spawn_flow
333
- [ `FlowWorld::spawn_flow_for` ] : https://docs.rs/edict/1.0.0-rc4/edict/flow/struct.FlowWorld.html#method.spawn_flow_for
334
- [ `FnArg` ] : https://docs.rs/edict/1.0.0-rc4/edict/system/trait.FnArg.html
335
- [ `IdRange` ] : https://docs.rs/edict/1.0.0-rc4/edict/entity/struct.IdRange.html
336
- [ `IdRangeAllocator` ] : https://docs.rs/edict/1.0.0-rc4/edict/entity/trait.IdRangeAllocator.html
337
- [ `IntoSystem` ] : https://docs.rs/edict/1.0.0-rc4/edict/system/trait.IntoSystem.html
338
- [ `LocalActionEncoder` ] : https://docs.rs/edict/1.0.0-rc4/edict/action/struct.LocalActionEncoder.html
339
- [ `Modified` ] : https://docs.rs/edict/1.0.0-rc4/edict/query/struct.Modified.html
340
- [ `NoSuchEntity` ] : https://docs.rs/edict/1.0.0-rc4/edict/struct.NoSuchEntity.html
341
- [ `Query` ] : https://docs.rs/edict/1.0.0-rc4/edict/query/trait.Query.html
342
- [ `Relation` ] : https://docs.rs/edict/1.0.0-rc4/edict/relation/trait.Relation.html
343
- [ `Res` ] : https://docs.rs/edict/1.0.0-rc4/edict/resources/struct.Res.html
344
- [ `ResMut` ] : https://docs.rs/edict/1.0.0-rc4/edict/resources/struct.ResMut.html
345
- [ `ResLocal` ] : https://docs.rs/edict/1.0.0-rc4/edict/system/struct.ResLocal.html
346
- [ `ResMutLocal` ] : https://docs.rs/edict/1.0.0-rc4/edict/system/struct.ResMutLocal.html
347
- [ `Scheduler` ] : https://docs.rs/edict/1.0.0-rc4/edict/scheduler/struct.Scheduler.html
348
- [ `ScopedExecutor` ] : https://docs.rs/edict/1.0.0-rc4/edict/executor/trait.ScopedExecutor.html
318
+ [ `Entities` ] : https://docs.rs/edict/1.0.0-rc6/edict/query/struct.Entities.html
319
+ [ `Entity` ] : https://docs.rs/edict/1.0.0-rc6/edict/entity/trait.Entity.html
320
+ [ `EntityBound` ] : https://docs.rs/edict/1.0.0-rc6/edict/entity/trait.EntityBound.html
321
+ [ `EntityId` ] : https://docs.rs/edict/1.0.0-rc6/edict/entity/struct.EntityId.html
322
+ [ `EntityLoc` ] : https://docs.rs/edict/1.0.0-rc6/edict/entity/struct.EntityLoc.html
323
+ [ `EntityRef` ] : https://docs.rs/edict/1.0.0-rc6/edict/entity/struct.EntityRef.html
324
+ [ `EntityRef::spawn_flow` ] : https://docs.rs/edict/1.0.0-rc6/edict/entity/struct.EntityRef.html#method.spawn_flow
325
+ [ `flow` ] : https://docs.rs/edict/1.0.0-rc6/edict/flow/index.html
326
+ [ `FlowEntity` ] : https://docs.rs/edict/1.0.0-rc6/edict/flow/struct.FlowEntity.html
327
+ [ `FlowEntity::spawn_flow` ] : https://docs.rs/edict/1.0.0-rc6/edict/flow/struct.FlowEntity.html#method.spawn_flow
328
+ [ `FlowEntity::wait_despawned` ] : https://docs.rs/edict/1.0.0-rc6/edict/flow/struct.FlowEntity.html#method.wait_despawned
329
+ [ `FlowEntity::wait_has_component` ] : https://docs.rs/edict/1.0.0-rc6/edict/flow/struct.FlowEntity.html#method.wait_has_component
330
+ [ `Flows` ] : https://docs.rs/edict/1.0.0-rc6/edict/flow/struct.Flows.html
331
+ [ `Flows::execute` ] : https://docs.rs/edict/1.0.0-rc6/edict/flow/struct.Flows.html#method.execute
332
+ [ `FlowWorld` ] : https://docs.rs/edict/1.0.0-rc6/edict/flow/struct.FlowWorld.html
333
+ [ `FlowWorld::spawn_flow` ] : https://docs.rs/edict/1.0.0-rc6/edict/flow/struct.FlowWorld.html#method.spawn_flow
334
+ [ `FlowWorld::spawn_flow_for` ] : https://docs.rs/edict/1.0.0-rc6/edict/flow/struct.FlowWorld.html#method.spawn_flow_for
335
+ [ `FnArg` ] : https://docs.rs/edict/1.0.0-rc6/edict/system/trait.FnArg.html
336
+ [ `IdRange` ] : https://docs.rs/edict/1.0.0-rc6/edict/entity/struct.IdRange.html
337
+ [ `IdRangeAllocator` ] : https://docs.rs/edict/1.0.0-rc6/edict/entity/trait.IdRangeAllocator.html
338
+ [ `IntoSystem` ] : https://docs.rs/edict/1.0.0-rc6/edict/system/trait.IntoSystem.html
339
+ [ `LocalActionEncoder` ] : https://docs.rs/edict/1.0.0-rc6/edict/action/struct.LocalActionEncoder.html
340
+ [ `Modified` ] : https://docs.rs/edict/1.0.0-rc6/edict/query/struct.Modified.html
341
+ [ `NoSuchEntity` ] : https://docs.rs/edict/1.0.0-rc6/edict/struct.NoSuchEntity.html
342
+ [ `Query` ] : https://docs.rs/edict/1.0.0-rc6/edict/query/trait.Query.html
343
+ [ `Relation` ] : https://docs.rs/edict/1.0.0-rc6/edict/relation/trait.Relation.html
344
+ [ `Res` ] : https://docs.rs/edict/1.0.0-rc6/edict/resources/struct.Res.html
345
+ [ `ResMut` ] : https://docs.rs/edict/1.0.0-rc6/edict/resources/struct.ResMut.html
346
+ [ `ResLocal` ] : https://docs.rs/edict/1.0.0-rc6/edict/system/struct.ResLocal.html
347
+ [ `ResMutLocal` ] : https://docs.rs/edict/1.0.0-rc6/edict/system/struct.ResMutLocal.html
348
+ [ `Scheduler` ] : https://docs.rs/edict/1.0.0-rc6/edict/scheduler/struct.Scheduler.html
349
+ [ `Scheduler::run_rayon` ] : https://docs.rs/edict/1.0.0-rc6/edict/scheduler/struct.Scheduler.html#method.run_rayon
350
+ [ `Scheduler::run_threaded` ] : https://docs.rs/edict/1.0.0-rc6/edict/scheduler/struct.Scheduler.html#method.run_threaded
351
+ [ `Scheduler::run_with` ] : https://docs.rs/edict/1.0.0-rc6/edict/scheduler/struct.Scheduler.html#method.run_with
352
+ [ `ScopedExecutor` ] : https://docs.rs/edict/1.0.0-rc6/edict/scheduler/trait.ScopedExecutor.html
349
353
[ `Send` ] : https://doc.rust-lang.org/std/marker/trait.Send.html
350
354
[ `Sized` ] : https://doc.rust-lang.org/std/marker/trait.Sized.html
351
- [ `State` ] : https://docs.rs/edict/1.0.0-rc4 /edict/system/struct.State.html
355
+ [ `State` ] : https://docs.rs/edict/1.0.0-rc6 /edict/system/struct.State.html
352
356
[ `std::error::Error` ] : https://doc.rust-lang.org/std/error/trait.Error.html
353
357
[ `Sync` ] : https://doc.rust-lang.org/std/marker/trait.Sync.html
354
- [ `System` ] : https://docs.rs/edict/1.0.0-rc4 /edict/system/trait.System.html
358
+ [ `System` ] : https://docs.rs/edict/1.0.0-rc6 /edict/system/trait.System.html
355
359
[ `TypeId` ] : https://doc.rust-lang.org/std/any/struct.TypeId.html
356
360
[ `Vec` ] : https://doc.rust-lang.org/std/vec/struct.Vec.html
357
- [ `View` ] : https://docs.rs/edict/1.0.0-rc4 /edict/view/type.View.html
358
- [ `ViewCell` ] : https://docs.rs/edict/1.0.0-rc4 /edict/view/type.ViewCell.html
359
- [ `ViewMut` ] : https://docs.rs/edict/1.0.0-rc4 /edict/view/type.ViewMut.html
360
- [ `ViewRef` ] : https://docs.rs/edict/1.0.0-rc4 /edict/view/type.ViewRef.html
361
- [ `WakeOnDrop` ] : https://docs.rs/edict/1.0.0-rc4 /edict/flow/struct.WakeOnDrop.html
362
- [ `World` ] : https://docs.rs/edict/1.0.0-rc4 /edict/world/struct.World.html
363
- [ `World::drop` ] : https://docs.rs/edict/1.0.0-rc4 /edict/world/struct.World.html#method.drop
364
- [ `World::epoch` ] : https://docs.rs/edict/1.0.0-rc4 /edict/world/struct.World.html#method.epoch
365
- [ `World::spawn_flow` ] : https://docs.rs/edict/1.0.0-rc4 /edict/world/struct.World.html#method.spawn_flow
366
- [ `World::spawn_flow_for` ] : https://docs.rs/edict/1.0.0-rc4 /edict/world/struct.World.html#method.spawn_flow_for
367
- [ `WorldBuilder` ] : https://docs.rs/edict/1.0.0-rc4 /edict/world/struct.WorldBuilder.html
368
- [ `WorldLocal` ] : https://docs.rs/edict/1.0.0-rc4 /edict/world/struct.WorldLocal.html
369
- [ `WorldLocal::defer*` ] : https://docs.rs/edict/1.0.0-rc4 /edict/world/struct.WorldLocal.html#method.defer
370
- [ `yield_now!` ] : https://docs.rs/edict/1.0.0-rc4 /edict/flow/macro.yield_now.html
361
+ [ `View` ] : https://docs.rs/edict/1.0.0-rc6 /edict/view/type.View.html
362
+ [ `ViewCell` ] : https://docs.rs/edict/1.0.0-rc6 /edict/view/type.ViewCell.html
363
+ [ `ViewMut` ] : https://docs.rs/edict/1.0.0-rc6 /edict/view/type.ViewMut.html
364
+ [ `ViewRef` ] : https://docs.rs/edict/1.0.0-rc6 /edict/view/type.ViewRef.html
365
+ [ `WakeOnDrop` ] : https://docs.rs/edict/1.0.0-rc6 /edict/flow/struct.WakeOnDrop.html
366
+ [ `World` ] : https://docs.rs/edict/1.0.0-rc6 /edict/world/struct.World.html
367
+ [ `World::drop` ] : https://docs.rs/edict/1.0.0-rc6 /edict/world/struct.World.html#method.drop
368
+ [ `World::epoch` ] : https://docs.rs/edict/1.0.0-rc6 /edict/world/struct.World.html#method.epoch
369
+ [ `World::spawn_flow` ] : https://docs.rs/edict/1.0.0-rc6 /edict/world/struct.World.html#method.spawn_flow
370
+ [ `World::spawn_flow_for` ] : https://docs.rs/edict/1.0.0-rc6 /edict/world/struct.World.html#method.spawn_flow_for
371
+ [ `WorldBuilder` ] : https://docs.rs/edict/1.0.0-rc6 /edict/world/struct.WorldBuilder.html
372
+ [ `WorldLocal` ] : https://docs.rs/edict/1.0.0-rc6 /edict/world/struct.WorldLocal.html
373
+ [ `WorldLocal::defer*` ] : https://docs.rs/edict/1.0.0-rc6 /edict/world/struct.WorldLocal.html#method.defer
374
+ [ `yield_now!` ] : https://docs.rs/edict/1.0.0-rc6 /edict/flow/macro.yield_now.html
371
375
372
376
## License
373
377
0 commit comments