pub struct ArrayStore {
pub entities: EntityTable,
/* private fields */
}Expand description
Storage for PostScript array element data.
Fields§
§entities: EntityTableImplementations§
Source§impl ArrayStore
impl ArrayStore
pub fn new() -> Self
Sourcepub fn allocate(&mut self, len: usize) -> EntityId
pub fn allocate(&mut self, len: usize) -> EntityId
Allocate len null-filled slots, returning an EntityId.
Sourcepub fn allocate_from(&mut self, items: &[PsObject]) -> EntityId
pub fn allocate_from(&mut self, items: &[PsObject]) -> EntityId
Allocate and copy items into the store.
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 via entity table indirection.
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 via entity table indirection.
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
Copy entity data to a new region (for COW). Returns the new EntityId pointing at the backup. The original entity’s offset is updated to point at the fresh copy.
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).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArrayStore
impl RefUnwindSafe for ArrayStore
impl Send for ArrayStore
impl Sync for ArrayStore
impl Unpin for ArrayStore
impl UnsafeUnpin for ArrayStore
impl UnwindSafe for ArrayStore
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