acmap 0.1.0

An actor-style sharded async map inspired by DashMap-like APIs.
Documentation
  • Coverage
  • 33.33%
    1 out of 3 items documented0 out of 0 items with examples
  • Size
  • Source code size: 35.86 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.36 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 42s Average build duration of successful builds.
  • all releases: 42s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • katteXu/acmap
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • katteXu

acmap

English | 中文

acmap is an actor-style, sharded async map for Rust, built on tokio channels.

It provides a DashMap-like API surface for common operations, with two write paths:

  • insert: request/response write (returns previous value)
  • insert_fast: fire-and-forget write for high-throughput scenarios

Features

  • Sharded actor model for parallel write handling
  • Async API for map operations
  • Fast-path write API for lower overhead
  • Simple benchmark example in examples/benchmark.rs

Installation

Add to your Cargo.toml:

[dependencies]
acmap = { path = "." }

Quick Start

use acmap::AcMap;

#[tokio::main]
async fn main() {
    let map = AcMap::<u64, u64>::new();

    assert_eq!(map.insert(1, 10).await, None);
    assert_eq!(map.get(1).await, Some(10));

    map.insert_fast(2, 20);
    assert!(map.contains_key(2).await);

    assert_eq!(map.len().await, 2);
}

Run

cargo test -q
cargo run --example benchmark -q

Project Layout

  • src/acmap/mod.rs: public API and sharding logic
  • src/acmap/messages.rs: actor message definitions
  • src/acmap/shard.rs: shard actor runtime loop
  • examples/benchmark.rs: benchmark-like demo

License

This project is licensed under the MIT License.