Crate avila_atom

Crate avila_atom 

Source
Expand description

§avila-atom

Atomic Computational Structures - Fundamental Data Structures

This library implements core data structures built from first principles, providing type-safe primitives for systems programming with zero-compromise performance characteristics.

§Available Structures

  • Option<T> - Optional value (presence/absence) - zero-cost abstraction
  • Result<T, E> - Result type (success/failure) - enum-based sum type
  • DynamicArray<T> - Contiguous growable array with amortized O(1) push
  • AssociativeArray<K, V> - Hash-based or tree-based key-value store
  • StringBuffer - UTF-8 encoded string with growable capacity

§Philosophy

These structures are atomic computational primitives - stable elements that compose infinitely to build complex software systems.

§Performance Characteristics

  • Zero-cost abstractions: No runtime overhead vs manual implementation
  • Memory locality: Contiguous allocation for cache efficiency
  • Compile-time optimization: Monomorphization enables aggressive inlining
  • Stack-preferred: Structures optimize for stack allocation when possible

§no_std Compatibility

All structures work in no_std environments with alloc feature:

  • AssociativeArray falls back to B-Tree (O(log n)) instead of HashMap (O(1))
  • Memory allocation via global allocator trait
  • Zero dependency on operating system primitives

Modules§

arena
Arena allocator for batch allocations without individual frees
bitset
BitSet - Compact set of integers
bloom
Bloom filter - probabilistic set membership
btree
B+Tree implementation for cache-efficient ordered data
buddy
Buddy Allocator - Power-of-2 memory allocator
compress
Inline compression for memory-constrained environments
cow
Copy-on-Write (CoW) array for immutable sharing
deque
Deque - Double-ended queue
fenwick
Fenwick Tree (Binary Indexed Tree) - Efficient prefix sums
fixed
Specialized array types with compile-time known sizes
graph
Graph - Adjacency list representation
heap
Binary heap - Priority queue with O(log N) operations
intrusive
Intrusive linked list - zero allocation overhead
iter
Iterator utilities and extensions
lockfree
Lock-free data structures using atomic operations
lru
LRU Cache - Least Recently Used cache with O(1) operations
matrix
Matrix - 2D array with SIMD operations
mpmc
MPMC Queue - Multi-producer multi-consumer lock-free queue
numa
NUMA-aware memory pool for multi-socket systems
perf
Performance optimization utilities
pool
Object pool for reusing allocations
radix
Radix tree (Patricia trie) for prefix-based lookups
rbtree
Red-Black Tree - Self-balancing binary search tree
robinhood
Robin Hood hash table - superior open addressing
rope
Rope - Efficient string structure for editing
segtree
Segment Tree - Range query data structure
simd
SIMD-optimized operations (when available)
sizes
Compile-time size constants for common types
skiplist
Lock-free concurrent skip list - O(log N) probabilistic search
slab
Slab Allocator - Fixed-size object allocator
smallvec
Small Vector - Stack-allocated vector for small sizes
sort
Sorting algorithms - Specialized sorting implementations
sparseset
Sparse Set - O(1) insertion, deletion, and membership
trie
Trie - Prefix tree for string operations
unionfind
Union-Find (Disjoint Set) for connectivity queries

Macros§

array
Macro for creating fixed-size arrays with type inference
list
Macro for convenient vector initialization
map
Macro for convenient map initialization with capacity hint
static_assert_size
Macro for compile-time size assertions

Enums§

Option
Optional value type - represents presence or absence of a value
Result
Result type - represents success (Ok) or failure (Err)

Constants§

VERSION
Library version constant

Traits§

DynamicArrayExt
Extension trait for DynamicArray with optimized methods

Type Aliases§

AssociativeArray
Hash map (std) or B-Tree map (no_std) for key-value storage
DynamicArray
Dynamic array with contiguous memory layout
StringBuffer
UTF-8 encoded string buffer