pub struct ComponentStorage {Show 78 fields
pub Window: Column<Window>,
pub GraphicsConfig: Column<GraphicsConfig>,
pub Shader: Column<Shader>,
pub Camera3D: Column<Camera3D>,
pub FrameInput: Column<FrameInput>,
pub Prop: Column<Prop>,
pub RigidBody: Column<RigidBody>,
pub PropBody: Column<PropBody>,
pub Room: Column<Room>,
pub DirectionalLight: Column<DirectionalLight>,
pub PointLight: Column<PointLight>,
pub SpotLight: Column<SpotLight>,
pub RectAreaLight: Column<RectAreaLight>,
pub ProceduralMesh: Column<ProceduralMesh>,
pub Model: Column<Model>,
pub Scene: Column<Scene>,
pub TextLabel: Column<TextLabel>,
pub HitRegion: Column<HitRegion>,
pub File: Column<File>,
pub BlockType: Column<BlockType>,
pub VoxelChunk: Column<VoxelChunk>,
pub InstancedProp: Column<InstancedProp>,
pub PostProcessConfig: Column<PostProcessConfig>,
pub Animation: Column<Animation>,
pub SkeletonPose: Column<SkeletonPose>,
pub StreamingConfig: Column<StreamingConfig>,
pub VoxelWorld: Column<VoxelWorld>,
pub AudioEmitter: Column<AudioEmitter>,
pub Sprite: Column<Sprite>,
pub KeyBinding: Column<KeyBinding>,
pub Screen: Column<Screen>,
pub Decal: Column<Decal>,
pub VolumetricFog: Column<VolumetricFog>,
pub PhysicsJoint: Column<PhysicsJoint>,
pub ParticleEmitter: Column<ParticleEmitter>,
pub WaterSurface: Column<WaterSurface>,
pub SdfVolume: Column<SdfVolume>,
pub GlassPanel: Column<GlassPanel>,
pub LayoutContainer: Column<LayoutContainer>,
pub PhysicsConfig: Column<PhysicsConfig>,
pub FpsCounter: Column<FpsCounter>,
pub StatHud: Column<StatHud>,
pub ScrollPanel: Column<ScrollPanel>,
pub ReflectionProbe: Column<ReflectionProbe>,
pub Transform: Column<Transform>,
pub PropInstance: Column<PropInstance>,
pub MeshRenderer: Column<MeshRenderer>,
pub ModelRenderer: Column<ModelRenderer>,
pub Collider: Column<Collider>,
pub BodyDynamics: Column<BodyDynamics>,
pub Interactable: Column<Interactable>,
pub Pickup: Column<Pickup>,
pub Parent: Column<Parent>,
pub Children: Column<Children>,
pub SceneMember: Column<SceneMember>,
pub GlobalTransform: Column<GlobalTransform>,
pub RenderHandle: Column<RenderHandle>,
pub Held: Column<Held>,
pub Lifetime: Column<Lifetime>,
pub Spawner: Column<Spawner>,
pub DebugHud: Column<DebugHud>,
pub AudioCue: Column<AudioCue>,
pub Story: Column<Story>,
pub AppConfig: Column<AppConfig>,
pub AnimationGraph: Column<AnimationGraph>,
pub AnimationParams: Column<AnimationParams>,
pub CharacterRig: Column<CharacterRig>,
pub GroundProbes: Column<GroundProbes>,
pub CameraProbe: Column<CameraProbe>,
pub TextInput: Column<TextInput>,
pub Behavior: Column<Behavior>,
pub Variables: Column<Variables>,
pub TriggerVolume: Column<TriggerVolume>,
pub Hidden: Column<Hidden>,
pub LoadingOverlay: Column<LoadingOverlay>,
pub AudioOcclusionProbe: Column<AudioOcclusionProbe>,
pub CharacterShape: Column<CharacterShape>,
pub EngineDefaults: Column<EngineDefaults>,
/* private fields */
}Expand description
One Column<T> per registered component type, the entity allocator
that stamps each row’s id, the change tick stamped on every structural
edit, and the join index that maps an entity to its row in each
column. Field columns are the caller’s field idents, reached through
the $slot trait; callers never name them directly.
Fields§
§Window: Column<Window>The column holding every row of one registered component type.
GraphicsConfig: Column<GraphicsConfig>The column holding every row of one registered component type.
Shader: Column<Shader>The column holding every row of one registered component type.
Camera3D: Column<Camera3D>The column holding every row of one registered component type.
FrameInput: Column<FrameInput>The column holding every row of one registered component type.
Prop: Column<Prop>The column holding every row of one registered component type.
RigidBody: Column<RigidBody>The column holding every row of one registered component type.
PropBody: Column<PropBody>The column holding every row of one registered component type.
Room: Column<Room>The column holding every row of one registered component type.
DirectionalLight: Column<DirectionalLight>The column holding every row of one registered component type.
PointLight: Column<PointLight>The column holding every row of one registered component type.
SpotLight: Column<SpotLight>The column holding every row of one registered component type.
RectAreaLight: Column<RectAreaLight>The column holding every row of one registered component type.
ProceduralMesh: Column<ProceduralMesh>The column holding every row of one registered component type.
Model: Column<Model>The column holding every row of one registered component type.
Scene: Column<Scene>The column holding every row of one registered component type.
TextLabel: Column<TextLabel>The column holding every row of one registered component type.
HitRegion: Column<HitRegion>The column holding every row of one registered component type.
File: Column<File>The column holding every row of one registered component type.
BlockType: Column<BlockType>The column holding every row of one registered component type.
VoxelChunk: Column<VoxelChunk>The column holding every row of one registered component type.
InstancedProp: Column<InstancedProp>The column holding every row of one registered component type.
PostProcessConfig: Column<PostProcessConfig>The column holding every row of one registered component type.
Animation: Column<Animation>The column holding every row of one registered component type.
SkeletonPose: Column<SkeletonPose>The column holding every row of one registered component type.
StreamingConfig: Column<StreamingConfig>The column holding every row of one registered component type.
VoxelWorld: Column<VoxelWorld>The column holding every row of one registered component type.
AudioEmitter: Column<AudioEmitter>The column holding every row of one registered component type.
Sprite: Column<Sprite>The column holding every row of one registered component type.
KeyBinding: Column<KeyBinding>The column holding every row of one registered component type.
Screen: Column<Screen>The column holding every row of one registered component type.
Decal: Column<Decal>The column holding every row of one registered component type.
VolumetricFog: Column<VolumetricFog>The column holding every row of one registered component type.
PhysicsJoint: Column<PhysicsJoint>The column holding every row of one registered component type.
ParticleEmitter: Column<ParticleEmitter>The column holding every row of one registered component type.
WaterSurface: Column<WaterSurface>The column holding every row of one registered component type.
SdfVolume: Column<SdfVolume>The column holding every row of one registered component type.
GlassPanel: Column<GlassPanel>The column holding every row of one registered component type.
LayoutContainer: Column<LayoutContainer>The column holding every row of one registered component type.
PhysicsConfig: Column<PhysicsConfig>The column holding every row of one registered component type.
FpsCounter: Column<FpsCounter>The column holding every row of one registered component type.
StatHud: Column<StatHud>The column holding every row of one registered component type.
ScrollPanel: Column<ScrollPanel>The column holding every row of one registered component type.
ReflectionProbe: Column<ReflectionProbe>The column holding every row of one registered component type.
Transform: Column<Transform>The column holding every row of one registered component type.
PropInstance: Column<PropInstance>The column holding every row of one registered component type.
MeshRenderer: Column<MeshRenderer>The column holding every row of one registered component type.
ModelRenderer: Column<ModelRenderer>The column holding every row of one registered component type.
Collider: Column<Collider>The column holding every row of one registered component type.
BodyDynamics: Column<BodyDynamics>The column holding every row of one registered component type.
Interactable: Column<Interactable>The column holding every row of one registered component type.
Pickup: Column<Pickup>The column holding every row of one registered component type.
Parent: Column<Parent>The column holding every row of one registered component type.
Children: Column<Children>The column holding every row of one registered component type.
SceneMember: Column<SceneMember>The column holding every row of one registered component type.
GlobalTransform: Column<GlobalTransform>The column holding every row of one registered component type.
RenderHandle: Column<RenderHandle>The column holding every row of one registered component type.
Held: Column<Held>The column holding every row of one registered component type.
Lifetime: Column<Lifetime>The column holding every row of one registered component type.
Spawner: Column<Spawner>The column holding every row of one registered component type.
DebugHud: Column<DebugHud>The column holding every row of one registered component type.
AudioCue: Column<AudioCue>The column holding every row of one registered component type.
Story: Column<Story>The column holding every row of one registered component type.
AppConfig: Column<AppConfig>The column holding every row of one registered component type.
AnimationGraph: Column<AnimationGraph>The column holding every row of one registered component type.
AnimationParams: Column<AnimationParams>The column holding every row of one registered component type.
CharacterRig: Column<CharacterRig>The column holding every row of one registered component type.
GroundProbes: Column<GroundProbes>The column holding every row of one registered component type.
CameraProbe: Column<CameraProbe>The column holding every row of one registered component type.
TextInput: Column<TextInput>The column holding every row of one registered component type.
Behavior: Column<Behavior>The column holding every row of one registered component type.
Variables: Column<Variables>The column holding every row of one registered component type.
TriggerVolume: Column<TriggerVolume>The column holding every row of one registered component type.
Hidden: Column<Hidden>The column holding every row of one registered component type.
LoadingOverlay: Column<LoadingOverlay>The column holding every row of one registered component type.
AudioOcclusionProbe: Column<AudioOcclusionProbe>The column holding every row of one registered component type.
CharacterShape: Column<CharacterShape>The column holding every row of one registered component type.
EngineDefaults: Column<EngineDefaults>The column holding every row of one registered component type.
Implementations§
Source§impl ComponentStorage
impl ComponentStorage
Sourcepub fn push_typed<C: ComponentSlot>(&mut self, c: C) -> Entity
pub fn push_typed<C: ComponentSlot>(&mut self, c: C) -> Entity
Push a statically-typed component into its column, minting a fresh Entity for the new row and recording it in the join index.
Sourcepub fn reserve(&mut self, component: ComponentId, additional: usize)
pub fn reserve(&mut self, component: ComponentId, additional: usize)
Pre-size a component’s column ahead of a bulk load (e.g. from a blob manifest’s per-type counts). Unknown ids are ignored.
Sourcepub fn spawn(&mut self) -> Entity
pub fn spawn(&mut self) -> Entity
Allocate a bare entity that owns no components yet. Useful for
gameplay-only entities and as the target of later insert_typed.
Sourcepub fn is_alive(&self, entity: Entity) -> bool
pub fn is_alive(&self, entity: Entity) -> bool
Whether a handle refers to a currently-live entity.
Sourcepub fn insert_typed<C: ComponentSlot>(&mut self, entity: Entity, c: C)
pub fn insert_typed<C: ComponentSlot>(&mut self, entity: Entity, c: C)
Add component C to an existing entity. Unlike push_typed this does
not mint an entity: it is how an entity comes to own more than one
component. The entity must be alive and must not already have C
(a second row for the same (entity, C) would desync the join).
Sourcepub fn remove_typed<C: ComponentSlot>(&mut self, entity: Entity) -> Option<C>
pub fn remove_typed<C: ComponentSlot>(&mut self, entity: Entity) -> Option<C>
Remove component C from an entity (leaving the entity alive and any other components intact), returning the value if present. Swap- remove moves the column’s last row into the freed slot, so the moved row’s owner has its recorded row patched.
Sourcepub fn despawn(&mut self, entity: Entity)
pub fn despawn(&mut self, entity: Entity)
Despawn an entity: swap-remove its row from every column it has, patching each moved tail row, then recycle the entity id. This is the structural-change primitive runtime despawn is built on.
Sourcepub fn drain<C: ComponentSlot>(&mut self) -> Vec<C>
pub fn drain<C: ComponentSlot>(&mut self) -> Vec<C>
Remove and return every component of type C. Each owner loses only its C component; an owner that has no other component left is despawned so its Entity recycles. An owner that still has other components stays alive with those intact and join-reachable. The whole C column empties at once, so no per-row tail patch is needed for C; only each owner’s C entry in the join is cleared.
Sourcepub fn values_mut<C: ComponentSlot>(&mut self) -> &mut [C]
pub fn values_mut<C: ComponentSlot>(&mut self) -> &mut [C]
Mutable slice of every component of type C, stamping the change tick because any element may be written.
Sourcepub fn values_mut_with_entities<C: ComponentSlot>(
&mut self,
) -> impl Iterator<Item = (Entity, &mut C)>
pub fn values_mut_with_entities<C: ComponentSlot>( &mut self, ) -> impl Iterator<Item = (Entity, &mut C)>
Mutable iteration over every component of type C paired with its owning entity, stamping the change tick because any element may be written. The mutable counterpart of the read-only column scan.
Sourcepub fn changed_tick<C: ComponentSlot>(&self) -> Tick
pub fn changed_tick<C: ComponentSlot>(&self) -> Tick
The change tick of C’s column: the tick at which any C was last inserted, removed, or mutably accessed. Read-only, so it never bumps the tick itself.
Sourcepub fn column_ticks<C: ComponentSlot>(&self) -> ColumnTicks
pub fn column_ticks<C: ComponentSlot>(&self) -> ColumnTicks
Every tick stamp of C’s column at once. A consumer that tracks
rows individually needs bulk and structural alongside
changed to know whether the per-row stamps still describe the
whole change.
Sourcepub fn changed_rows<C: ComponentSlot>(
&self,
since: Tick,
) -> impl Iterator<Item = (Entity, &C)>
pub fn changed_rows<C: ComponentSlot>( &self, since: Tick, ) -> impl Iterator<Item = (Entity, &C)>
Rows of C written since since, paired with their owning entity.
Only the rows a targeted get_mut touched are reported, so this
is the dirty set a per-frame pass re-examines instead of the whole
column. Meaningful only while C’s bulk and structural ticks
have not moved since since; past either, every row must be
treated as changed.
Sourcepub fn get<C: ComponentSlot>(&self, entity: Entity) -> Option<&C>
pub fn get<C: ComponentSlot>(&self, entity: Entity) -> Option<&C>
Borrow one entity’s component C, if it has one.
Sourcepub fn get_mut<C: ComponentSlot>(&mut self, entity: Entity) -> Option<&mut C>
pub fn get_mut<C: ComponentSlot>(&mut self, entity: Entity) -> Option<&mut C>
Mutably borrow one entity’s component C, stamping that row’s
change tick (and the column’s) but not the bulk tick, so
changed_rows can report exactly this entity.
Sourcepub fn join2<'s, A: ComponentSlot, B: ComponentSlot>(
&'s self,
) -> impl Iterator<Item = (Entity, &'s A, &'s B)> + 's
pub fn join2<'s, A: ComponentSlot, B: ComponentSlot>( &'s self, ) -> impl Iterator<Item = (Entity, &'s A, &'s B)> + 's
Read-only join over two component types. Iterates the first type’s rows and, for each owning entity that also has the second type, yields both component refs. This is the multi-component query for read paths (the draw-list push, scene visibility): one column scan plus a join probe per row, no allocation.
Sourcepub fn join3<'s, A: ComponentSlot, B: ComponentSlot, C: ComponentSlot>(
&'s self,
) -> impl Iterator<Item = (Entity, &'s A, &'s B, &'s C)> + 's
pub fn join3<'s, A: ComponentSlot, B: ComponentSlot, C: ComponentSlot>( &'s self, ) -> impl Iterator<Item = (Entity, &'s A, &'s B, &'s C)> + 's
Read-only join over three component types, lead on the first.
Source§impl ComponentStorage
impl ComponentStorage
Sourcepub fn push(&mut self, asset: ComponentAsset) -> Entity
pub fn push(&mut self, asset: ComponentAsset) -> Entity
Dispatch a ComponentAsset variant into its typed column via the
generic typed push (which mints the Entity and stamps the tick).
Returns the minted Entity so loaders can index it by name.
Sourcepub fn replace(&mut self, entity: Entity, asset: ComponentAsset) -> bool
pub fn replace(&mut self, entity: Entity, asset: ComponentAsset) -> bool
Overwrite the component the asset’s variant addresses on
entity, keeping the entity and its other components, and
stamping the change tick so the frame’s readers see it.
false when the entity holds no component of that type.
Sourcepub fn entities_with_tag(&self, tag: u8) -> &[Entity]
pub fn entities_with_tag(&self, tag: u8) -> &[Entity]
Every entity carrying the component with this tag, in column order. Serves the declared-query resolution in BehaviorSystem, which selects components by authored name rather than by type.
Sourcepub fn component_census(&self) -> Vec<(u8, u32)>
pub fn component_census(&self) -> Vec<(u8, u32)>
How many components of each type are stored: one (tag, count)
entry per populated type, in tag order. The debug WS snapshot
reports these; nothing re-serializes stored components back to
defs. Counted rather than listed per instance, so the snapshot
is sized by the number of component types rather than by the
world.