VertexStore

Struct VertexStore 

Source
#[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

Source

pub fn view(&self, id: VertexId) -> VertexView<'_>

Create an immutable view for a vertex

Source

pub fn view_mut(&mut self, id: VertexId) -> VertexViewMut<'_>

Create a mutable view for a vertex

Source

pub fn debug_vertex(&self, id: VertexId) -> String

Debug helper to dump vertex info

Source

pub fn debug_range(&self, start: VertexId, count: usize) -> Vec<String>

Debug helper to dump a range of vertices

Source§

impl VertexStore

Source

pub fn new() -> Self

Source

pub fn with_capacity(capacity: usize) -> Self

Source

pub fn reserve(&mut self, additional: usize)

Reserve additional capacity for upcoming vertex allocations.

Source

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

Source

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.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn coord(&self, id: VertexId) -> PackedCoord

Source

pub fn sheet_id(&self, id: VertexId) -> SheetId

Source

pub fn kind(&self, id: VertexId) -> VertexKind

Source

pub fn set_kind(&mut self, id: VertexId, kind: VertexKind)

Source

pub fn flags(&self, id: VertexId) -> u8

Source

pub fn is_dirty(&self, id: VertexId) -> bool

Source

pub fn is_volatile(&self, id: VertexId) -> bool

Source

pub fn is_deleted(&self, id: VertexId) -> bool

Source

pub fn set_dirty(&self, id: VertexId, dirty: bool)

Source

pub fn set_volatile(&self, id: VertexId, volatile: bool)

Source

pub fn value_ref(&self, id: VertexId) -> u32

Source

pub fn set_value_ref(&mut self, id: VertexId, value_ref: u32)

Source

pub fn edge_offset(&self, id: VertexId) -> u32

Source

pub fn set_edge_offset(&mut self, id: VertexId, offset: u32)

Source

pub fn mark_deleted(&self, id: VertexId, deleted: bool)

Mark vertex as deleted (tombstone strategy)

Source

pub fn vertex_exists(&self, id: VertexId) -> bool

Check if vertex exists (may be deleted/tombstoned)

Source

pub fn vertex_exists_active(&self, id: VertexId) -> bool

Check if vertex exists and is not deleted

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VertexStore

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,