pub struct DualArrayStore {
pub global: ArrayStore,
pub local: ArrayStore,
}Expand description
Dual-arena array store with separate global and local backing stores.
Fields§
§global: ArrayStore§local: ArrayStoreImplementations§
Source§impl DualArrayStore
impl DualArrayStore
pub fn new() -> Self
Sourcepub fn allocate_from(&mut self, items: &[PsObject]) -> EntityId
pub fn allocate_from(&mut self, items: &[PsObject]) -> EntityId
Allocate and copy items into local VM.
Sourcepub fn allocate_from_with(
&mut self,
items: &[PsObject],
save_level: u16,
global: bool,
created_after_save: u32,
) -> EntityId
pub fn allocate_from_with( &mut self, items: &[PsObject], save_level: u16, global: bool, created_after_save: u32, ) -> EntityId
Allocate and copy items with a specific save level and global flag.
Sourcepub fn allocate_with(
&mut self,
len: usize,
save_level: u16,
global: bool,
created_after_save: u32,
) -> EntityId
pub fn allocate_with( &mut self, len: usize, save_level: u16, global: bool, created_after_save: u32, ) -> EntityId
Allocate with a specific save level and global flag.
Sourcepub fn get(&self, entity: EntityId, start: u32, len: u32) -> &[PsObject]
pub fn get(&self, entity: EntityId, start: u32, len: u32) -> &[PsObject]
Get a slice of array elements.
Sourcepub fn get_mut(
&mut self,
entity: EntityId,
start: u32,
len: u32,
) -> &mut [PsObject]
pub fn get_mut( &mut self, entity: EntityId, start: u32, len: u32, ) -> &mut [PsObject]
Get a mutable slice of array elements.
Sourcepub fn get_element(&self, entity: EntityId, index: u32) -> PsObject
pub fn get_element(&self, entity: EntityId, index: u32) -> PsObject
Get a single element.
Sourcepub fn set_element(&mut self, entity: EntityId, index: u32, obj: PsObject)
pub fn set_element(&mut self, entity: EntityId, index: u32, obj: PsObject)
Set a single element.
Sourcepub fn cow_copy(&mut self, entity: EntityId) -> EntityId
pub fn cow_copy(&mut self, entity: EntityId) -> EntityId
COW copy (always local — global entities skip COW).
Sourcepub fn swap_offsets(&mut self, a: EntityId, b: EntityId)
pub fn swap_offsets(&mut self, a: EntityId, b: EntityId)
Swap offsets between two entities (used by restore, always local).
Sourcepub fn entity_meta(&self, entity: EntityId) -> &EntityMeta
pub fn entity_meta(&self, entity: EntityId) -> &EntityMeta
Get entity metadata (read-only).
Sourcepub fn entity_meta_mut(&mut self, entity: EntityId) -> &mut EntityMeta
pub fn entity_meta_mut(&mut self, entity: EntityId) -> &mut EntityMeta
Get mutable entity metadata.
Sourcepub fn entity_count(&self) -> usize
pub fn entity_count(&self) -> usize
Total entity count across both stores.
Sourcepub fn reset_local(&mut self)
pub fn reset_local(&mut self)
Reset local VM (for job boundary cleanup).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DualArrayStore
impl RefUnwindSafe for DualArrayStore
impl Send for DualArrayStore
impl Sync for DualArrayStore
impl Unpin for DualArrayStore
impl UnsafeUnpin for DualArrayStore
impl UnwindSafe for DualArrayStore
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