pub struct DualStringStore {
pub global: StringStore,
pub local: StringStore,
}Expand description
Dual-arena string store with separate global and local backing stores.
Fields§
§global: StringStore§local: StringStoreImplementations§
Source§impl DualStringStore
impl DualStringStore
pub fn new() -> Self
Sourcepub fn allocate_at_level_zero(&mut self, len: usize) -> EntityId
pub fn allocate_at_level_zero(&mut self, len: usize) -> EntityId
Allocate len zero-filled bytes in local VM, stamped as if no save were outstanding.
The entity is stamped save_level = 0, global = false,
created_after_save = 0 — it claims to predate every outstanding
save. That is only true during bootstrap, before any save can have
happened. Everywhere else prefer the VM-aware helpers in
stet_ops::vm_ops (alloc_dict / alloc_array / alloc_string, or
their _in variants): an entity mis-stamped this way is invisible to
the invalidrestore check while still being released by the matching
restore.
Sourcepub fn allocate_from_at_level_zero(&mut self, bytes: &[u8]) -> EntityId
pub fn allocate_from_at_level_zero(&mut self, bytes: &[u8]) -> EntityId
Allocate and copy bytes into local VM, stamped as if no save were outstanding.
The entity is stamped save_level = 0, global = false,
created_after_save = 0 — it claims to predate every outstanding
save. That is only true during bootstrap, before any save can have
happened. Everywhere else prefer the VM-aware helpers in
stet_ops::vm_ops (alloc_dict / alloc_array / alloc_string, or
their _in variants): an entity mis-stamped this way is invisible to
the invalidrestore check while still being released by the matching
restore.
Sourcepub fn allocate_from_with(
&mut self,
bytes: &[u8],
save_level: u16,
global: bool,
created_after_save: u32,
) -> EntityId
pub fn allocate_from_with( &mut self, bytes: &[u8], save_level: u16, global: bool, created_after_save: u32, ) -> EntityId
Allocate and copy bytes 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) -> &[u8] ⓘ
pub fn get(&self, entity: EntityId, start: u32, len: u32) -> &[u8] ⓘ
Get a slice of the string data.
Sourcepub fn get_mut(&mut self, entity: EntityId, start: u32, len: u32) -> &mut [u8] ⓘ
pub fn get_mut(&mut self, entity: EntityId, start: u32, len: u32) -> &mut [u8] ⓘ
Get a mutable slice of the string data.
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).