edict/action/
mod.rs

1//! This module contains definitions for action recording.
2//! Actions can be recorded into [`ActionEncoder`] and executed later onto the [`World`].
3//! Two primary use cases for actions are:
4//! * Deferring [`World`] mutations when [`World`] is borrowed immutably, like in most [`Systems`]
5//! * Generating actions in custom component drop-glue.
6//!
7//! [`Systems`]: edict::system::System
8
9use crate::world::World;
10
11mod buffer;
12mod channel;
13mod encoder;
14
15tiny_fn::tiny_fn! {
16    pub(crate) struct ActionFn = FnOnce(world: &mut World) | + Send;
17    pub(crate) struct LocalActionFn = FnOnce(world: &mut World);
18}
19
20pub use self::{
21    buffer::{ActionBuffer, ActionBufferSliceExt, LocalActionBuffer},
22    channel::{ActionSender, SpawnBatchChannel},
23    encoder::{ActionEncoder, LocalActionEncoder, LocalSpawnBatch, SpawnBatch},
24};
25
26pub(crate) use self::channel::ActionChannel;