| Crates.io | acceptor-alloc |
| lib.rs | acceptor-alloc |
| version | 0.0.1 |
| created_at | 2025-12-01 07:34:11.801955+00 |
| updated_at | 2025-12-01 07:34:11.801955+00 |
| description | alloc-based acceptors built on the accepts core traits |
| homepage | https://github.com/acceptor-rs/acceptor-alloc |
| repository | https://github.com/acceptor-rs/acceptor-alloc |
| max_upload_size | |
| id | 1959403 |
| size | 25,460 |
acceptor-alloc is an alloc-powered bundle of acceptors built on the accepts core traits. It provides acceptors that require heap-backed collections without pulling in std.
⚠️ Pre-release: version 0.0.1 is experimental. APIs and crate layout may change without backward compatibility guarantees.
[dependencies]
acceptor-alloc = "0.0.1"
(Key, Value) pairs using BTreeKVRouteruse alloc::collections::BTreeMap;
use acceptor_alloc::BTreeKVRouter;
use accepts::Accepts;
#[derive(Clone, Debug, Default)]
struct Sink;
impl Accepts<(char, i32)> for Sink {
fn accept(&self, pair: (char, i32)) {
core::hint::black_box(pair);
}
}
let mut routes = BTreeMap::new();
routes.insert('a', Sink);
// fallback is a no-op `()`, which implements `Accepts`.
let router = BTreeKVRouter::new(routes);
router.accept(('a', 1)); // routed to Sink
router.accept(('z', 2)); // routed to fallback (no-op)
| acceptor-alloc | accepts |
|---|---|
| 0.0.1 | 0.0.2 |
See ARCHITECTURE.md for design notes and the broader acceptor series lineup.
MIT OR Apache-2.0