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§

fixed
Specialized array types with compile-time known sizes
iter
Iterator utilities and extensions
sizes
Compile-time size constants for common types

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

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