Crate sable_core

Crate sable_core 

Source
Expand description

§Sable Core

Core utilities, math primitives, and foundational types for the Sable engine.

§Modules

  • math — Vector, matrix, and quaternion types
  • handle — Generational index handles for safe resource references
  • color — Color types with various color space support
  • time — Time tracking and delta time utilities

§Feature Flags

  • f64 — Use 64-bit floats instead of 32-bit for math types
  • parallel — Enable parallel iteration with rayon and concurrent data structures
  • async — Enable async time utilities with tokio

§Parallelization

With the parallel feature (enabled by default), you can use parallel iteration:

use rayon::prelude::*;

// Parallel iteration over handle allocator values
allocator.par_values().for_each(|value| {
    // Process in parallel
});

// Thread-safe concurrent allocator
use sable_core::handle::ConcurrentHandleAllocator;
let allocator = ConcurrentHandleAllocator::new();

§Async Support

With the async feature, async time utilities are available:

use sable_core::time::async_time::{sleep, Interval, timeout};

async fn game_loop() {
    let mut interval = Interval::from_hz(60.0);
    loop {
        interval.tick().await;
        update();
    }
}

Re-exports§

pub use rayon;

Modules§

color
Color types with various color space support.
handle
Generational index handles for safe resource references.
math
Math primitives for the Sable engine.
prelude
Prelude module for convenient imports.
time
Time tracking utilities.