os_slab_vault 0.1.0

Dependency-free, no_std generational slab/object-pool for Rust OS kernels.
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented0 out of 0 items with examples
  • Size
  • Source code size: 47.44 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 500.92 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • alisio85/os_slab_vault
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • alisio85

os_slab_vault

os_slab_vault is a dependency-free, no_std-first generational slab / object-pool crate designed for Rust operating system kernels and other bare-metal runtimes.

It provides:

  • Fixed-capacity storage (Slab<T, N>) with O(1) insert/remove.
  • Generation-checked handles (Key) that detect stale use-after-free.
  • Allocation-free iteration over live objects.
  • A carefully-audited, tiny amount of unsafe (fully documented).

This crate is released under the MIT license.

Attribution: Portions of this crate were generated by an AI assistant (ChatGPT) based on an idea by alisio85.

Goals

  • Kernel-friendly: deterministic, allocation-free, no_std by default.
  • Safety: safe API prevents invalid access; generation counters detect stale keys.
  • Small surface area: easy to audit, easy to port, easy to embed.

Non-goals

  • Variable-capacity growth (no heap).
  • Locking / synchronization (bring your own spinlock/mutex if you need concurrency).
  • Architecture-specific features (this crate is platform-agnostic).

Quick example

use os_slab_vault::Slab;

let mut tasks: Slab<&'static str, 4> = Slab::new();

let a = tasks.insert("init").unwrap();
let b = tasks.insert("idle").unwrap();

assert_eq!(tasks.get(a), Some(&"init"));
assert_eq!(tasks.remove(b).unwrap(), "idle");

// `b` is now stale: generation check prevents accidental re-use.
assert!(tasks.get(b).is_none());

Documentation

  • API docs on docs.rs
  • Project documentation in docs/:
    • docs/MANUAL.md (ultra-detailed)
    • docs/COOKBOOK.md
    • docs/SAFETY.md
    • docs/DESIGN.md
    • docs/FAQ.md
    • docs/CI_AND_RELEASE.md
    • docs/SEMVER.md
    • docs/HANDLES_AND_GENERATIONS.md

Minimum supported Rust

This crate targets Rust 2024 edition and is intended to be used with a recent stable toolchain.