pub struct SharedLinkedList<T: Copy + Default + 'static> { /* private fields */ }Implementations§
pub fn create( path: impl AsRef<Path>, capacity: usize, ) -> Result<Self, LinkedListError>
pub fn open( path: impl AsRef<Path>, capacity: usize, ) -> Result<Self, LinkedListError>
pub fn capacity(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn region(&self) -> &SharedRegion<Node<T>>
pub fn region(&self) -> &SharedRegion<Node<T>>
Access the underlying region (advanced use; e.g., to wrap writes in a SharedSemaphore for cross-process serialisation).
Sourcepub fn push_front(&self, value: T) -> Result<NodeHandle<T>, LinkedListError>
pub fn push_front(&self, value: T) -> Result<NodeHandle<T>, LinkedListError>
Push to the front of the list. Returns a stable NodeHandle.
Sourcepub fn push_back(&self, value: T) -> Result<NodeHandle<T>, LinkedListError>
pub fn push_back(&self, value: T) -> Result<NodeHandle<T>, LinkedListError>
Push to the back of the list. Returns a stable NodeHandle.
Sourcepub fn remove(&self, handle: NodeHandle<T>) -> Option<T>
pub fn remove(&self, handle: NodeHandle<T>) -> Option<T>
Remove the node referenced by handle in O(1) (splice +
free the slot). Returns the removed value or None when the
handle is the sentinel head OR was already freed.
Sourcepub fn get(&self, handle: NodeHandle<T>) -> Option<T>
pub fn get(&self, handle: NodeHandle<T>) -> Option<T>
Read the value at handle. Returns None for nil or stale
handle (after remove).
Sourcepub fn set(
&self,
handle: NodeHandle<T>,
value: T,
) -> Result<(), LinkedListError>
pub fn set( &self, handle: NodeHandle<T>, value: T, ) -> Result<(), LinkedListError>
Overwrite the value at handle (keeping the node’s position
in the list).
Sourcepub fn iter_forward(&self) -> Vec<T>
pub fn iter_forward(&self) -> Vec<T>
Snapshot of all values in forward order.
Sourcepub fn iter_backward(&self) -> Vec<T>
pub fn iter_backward(&self) -> Vec<T>
Snapshot of all values in reverse order (back to front).
Sourcepub fn iter_forward_with_handles(&self) -> Vec<(NodeHandle<T>, T)>
pub fn iter_forward_with_handles(&self) -> Vec<(NodeHandle<T>, T)>
Snapshot of all (handle, value) pairs in forward order. Useful for finding a handle by predicate, then removing it.