chiralmap 0.1.1

Left-Right map using IndexMap
Documentation
# `chiralmap` [![crates.io]https://img.shields.io/crates/v/chiralmap]https://crates.io/crates/chiralmap [![Please don't upload to GitHub]https://nogithub.codeberg.page/badge.svg]https://nogithub.codeberg.page

An IndexMap with Left-Right synchronization.

This creates 2 maps internally that are swapped at every flush. The flush is
required because the map is eventually consistent and the readers will only see
the new items once the maps are swapped.
See [left_right](https://docs.rs/left-right).

Write operations are funneled into a channel that is processed by a single
thread. Creating a ChiralMap will automatically spawn this thread internally.
The thread will be terminated when the last copy of ChiralMap is dropped.

The advantage of this data structure is to have access to read handles that are
lock-free, as the map that is currently in read mode is basically immutable.

How to use with handles:

```rust
use chiralmap::ChiralMap;

let map = ChiralMap::<String, String>::default();
map.insert("A".into(), "B".into()).unwrap();
map.flush();

let h = map.read_handle();
let v = h.get(&"A".to_string()).unwrap();
println!("{v}"); // "B"
```

In case the map is shared across a web framework (requires being Sync),
then internally it uses a read pool which can be acquired through locking.
The api makes this transparent with the `get()` method.

```rust
use chiralmap::ChiralMap;

let map = ChiralMap::<String, String>::default();
map.insert("A".into(), "B".into()).unwrap();
map.flush();

let v = map.get(&"A".to_string()).unwrap();
println!("{v}"); // "B"
```