pub struct ActionContext<'a> {
pub actor: Option<EntityId>,
pub now: Tick,
pub instance_id: InstanceId,
/* private fields */
}Expand description
Read-only context passed to ActionCompute::compute.
Carries the originating actor, current tick, and a borrowed view
of the instance for limited introspection.
Fields§
§actor: Option<EntityId>Optional originating entity (e.g. the player who submitted the
action). None for system-injected actions.
now: TickTick at which step() is processing this action.
instance_id: InstanceIdInstanceId of the instance the action runs against.
Implementations§
Source§impl<'a> ActionContext<'a>
impl<'a> ActionContext<'a>
Sourcepub fn entities_len(&self) -> usize
pub fn entities_len(&self) -> usize
Number of entities currently registered in the instance.
Sourcepub fn components_len(&self) -> usize
pub fn components_len(&self) -> usize
Total component count across all entities.
Sourcepub fn local_tick(&self) -> u64
pub fn local_tick(&self) -> u64
Logical local tick of the instance.
Auto Trait Implementations§
impl<'a> Freeze for ActionContext<'a>
impl<'a> RefUnwindSafe for ActionContext<'a>
impl<'a> Send for ActionContext<'a>
impl<'a> Sync for ActionContext<'a>
impl<'a> Unpin for ActionContext<'a>
impl<'a> UnsafeUnpin for ActionContext<'a>
impl<'a> UnwindSafe for ActionContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more