1 unstable release
0.1.4 | Aug 26, 2022 |
---|---|
0.1.3 |
|
0.1.2 |
|
0.1.1 |
|
0.1.0 |
|
#754 in Concurrency
68 downloads per month
39KB
713 lines
rose_bloom
rose_bloom
is a crate for passing out references that won't move when you push to it. It also
happens to be accidentally thread-safe, so you can also use it as a concurrent queue, if you don't
care about freeing memory. This is a lock-free data structure.
Example
use rose_bloom::Rose;
let rose = Rose::new();
let out1 = rose.push(1);
rose.push(2);
rose.push(3);
println!("{out1}"); // 1
Installation
Add this to your Cargo.toml:
[dependencies]
rose_bloom = "0.1"
#![no_std]
This crate is #![no_std]
but does require the alloc
crate.
Licenses
lib.rs
:
This library provides the Rose
type, which is a data structure that has stable pointers.
It also happens to concurrent, which was a secondary goal of this project, because you can't
have a safe API without Atomics.
Example
use rose_bloom::Rose;
let rose = Rose::new();
let out1 = rose.push(1);
rose.push(2);
rose.push(3);
println!("{out1}");