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_from(&mut self, bytes: &[u8]) -> EntityId
pub fn allocate_from(&mut self, bytes: &[u8]) -> EntityId
Allocate and copy bytes into local VM.
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).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DualStringStore
impl RefUnwindSafe for DualStringStore
impl Send for DualStringStore
impl Sync for DualStringStore
impl Unpin for DualStringStore
impl UnsafeUnpin for DualStringStore
impl UnwindSafe for DualStringStore
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