#[repr(C, align(64))]pub struct VertexStore { /* private fields */ }Expand description
Core columnar storage for vertices in Struct-of-Arrays layout
Memory layout optimized for cache efficiency:
- 21B logical per vertex (no struct padding)
- Dense columnar arrays for hot data
- Atomic flags for lock-free operations
Implementations§
Source§impl VertexStore
impl VertexStore
Sourcepub fn view(&self, id: VertexId) -> VertexView<'_>
pub fn view(&self, id: VertexId) -> VertexView<'_>
Create an immutable view for a vertex
Sourcepub fn view_mut(&mut self, id: VertexId) -> VertexViewMut<'_>
pub fn view_mut(&mut self, id: VertexId) -> VertexViewMut<'_>
Create a mutable view for a vertex
Sourcepub fn debug_vertex(&self, id: VertexId) -> String
pub fn debug_vertex(&self, id: VertexId) -> String
Debug helper to dump vertex info
Source§impl VertexStore
impl VertexStore
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserve additional capacity for upcoming vertex allocations.
Sourcepub fn allocate(
&mut self,
coord: PackedCoord,
sheet: SheetId,
flags: u8,
) -> VertexId
pub fn allocate( &mut self, coord: PackedCoord, sheet: SheetId, flags: u8, ) -> VertexId
Allocate a new vertex, returning its ID IDs start at FIRST_NORMAL_VERTEX to reserve 0-1023 for special vertices
Sourcepub fn allocate_contiguous(
&mut self,
sheet: SheetId,
coords: &[PackedCoord],
flags: u8,
) -> Vec<VertexId>
pub fn allocate_contiguous( &mut self, sheet: SheetId, coords: &[PackedCoord], flags: u8, ) -> Vec<VertexId>
Allocate many vertices contiguously in the current store order. Returns the assigned VertexIds in the same order as input coords.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn coord(&self, id: VertexId) -> PackedCoord
pub fn sheet_id(&self, id: VertexId) -> SheetId
pub fn kind(&self, id: VertexId) -> VertexKind
pub fn set_kind(&mut self, id: VertexId, kind: VertexKind)
pub fn flags(&self, id: VertexId) -> u8
pub fn is_dirty(&self, id: VertexId) -> bool
pub fn is_volatile(&self, id: VertexId) -> bool
pub fn is_deleted(&self, id: VertexId) -> bool
pub fn set_dirty(&self, id: VertexId, dirty: bool)
pub fn set_volatile(&self, id: VertexId, volatile: bool)
pub fn value_ref(&self, id: VertexId) -> u32
pub fn set_value_ref(&mut self, id: VertexId, value_ref: u32)
pub fn edge_offset(&self, id: VertexId) -> u32
pub fn set_edge_offset(&mut self, id: VertexId, offset: u32)
Sourcepub fn mark_deleted(&self, id: VertexId, deleted: bool)
pub fn mark_deleted(&self, id: VertexId, deleted: bool)
Mark vertex as deleted (tombstone strategy)
Sourcepub fn vertex_exists(&self, id: VertexId) -> bool
pub fn vertex_exists(&self, id: VertexId) -> bool
Check if vertex exists (may be deleted/tombstoned)
Sourcepub fn vertex_exists_active(&self, id: VertexId) -> bool
pub fn vertex_exists_active(&self, id: VertexId) -> bool
Check if vertex exists and is not deleted
Sourcepub fn all_vertices(&self) -> impl Iterator<Item = VertexId> + '_
pub fn all_vertices(&self) -> impl Iterator<Item = VertexId> + '_
Get an iterator over all vertex IDs (including deleted ones)
Trait Implementations§
Source§impl Debug for VertexStore
impl Debug for VertexStore
Auto Trait Implementations§
impl Freeze for VertexStore
impl RefUnwindSafe for VertexStore
impl Send for VertexStore
impl Sync for VertexStore
impl Unpin for VertexStore
impl UnwindSafe for VertexStore
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more