https://github.com/acceptor-rs/acceptor-alloc
alloc-based acceptors built on the accepts core traits
https://github.com/acceptor-rs/acceptor-alloc
acceptor accepts alloc async no-std no-std-alloc pipeline rust
Last synced: 30 days ago
JSON representation
alloc-based acceptors built on the accepts core traits
- Host: GitHub
- URL: https://github.com/acceptor-rs/acceptor-alloc
- Owner: acceptor-rs
- License: apache-2.0
- Created: 2025-12-01T07:27:46.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-12-01T07:28:59.000Z (2 months ago)
- Last Synced: 2025-12-21T01:43:51.321Z (about 2 months ago)
- Topics: acceptor, accepts, alloc, async, no-std, no-std-alloc, pipeline, rust
- Language: Rust
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# acceptor-alloc
[](https://crates.io/crates/acceptor-alloc)
[](https://docs.rs/acceptor-alloc)
[](LICENSE-MIT)
[](https://github.com/acceptor-rs/acceptor-alloc/actions/workflows/ci.yml)
`acceptor-alloc` is an `alloc`-powered bundle of acceptors built on the [`accepts`](https://crates.io/crates/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.
## Add the dependency
```toml
[dependencies]
acceptor-alloc = "0.0.1"
```
## Example: route `(Key, Value)` pairs using `BTreeKVRouter`
```rust
use 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)
```
## Version map
| acceptor-alloc | accepts |
| --- | --- |
| 0.0.1 | 0.0.2 |
## More
See ARCHITECTURE.md for design notes and the broader acceptor series lineup.
## License
MIT OR Apache-2.0