Crate structures

Source
Expand description

§Structures

Implementation of various heap allocated data structures.

§Safety

The goal is to implement everything from scratch. That requires working with raw pointers and memory. So unsafe is (conservatively) used in the crate. As of now Miri is used to test for undefined behavior.

§Array

An Array is a fixed length collection of elements held in contagious memory segment. This is the heap allocated equivalent of a stack allocated array. Since this data structure is heap allocated, length of the array can be provided at runtime.

§LazyArray

A LazyArray is an array that can hold uninitialized elements. Elements can be safely aliased only after initialization, which the responsibility of the caller and thus requires use of unsafe. Additionally caller is responsible for dropping initialized values (which also requires unsafe).

§RingArray

A RingArray is a simple ring buffer that uses a LazyArray to store elements.

Macros§

array
Initialize an Array with array like syntax.

Structs§

Array
A fixed length collection of elements held in contagious memory segment.
RingArray
A ring buffer that uses a LazyArray for storage.

Type Aliases§

LazyArray
Type alias for an Array that may have uninitialized values.