lexicon_fractional_index

Crates.iolexicon_fractional_index
lib.rslexicon_fractional_index
version0.0.4-a1
sourcesrc
created_at2021-12-07 06:35:04.537371
updated_at2022-01-17 05:48:45.630099
descriptionFractional index implementation migrated from Go/JavaScript
homepagehttps://github.com/TODO/lexicon-fractional-index/
repositoryhttps://github.com/TODO/lexicon-fractional-index/
max_upload_size
id493644
size44,574
(sh-tiye)

documentation

https://docs.rs/crate/lexicon_fractional_index/

README

Lexicon Fractional Index

A Rust version for fractional-indexing . Keys in string and satisfy lexicographic order.

Rewritten from existed codebase:

Usage

Docs.

use lexicon_fractional_index::key_between;

// create an initial key
let k0 = key_between(None, None)?;

// two keys, notice that some strings are not valid keys
let left = "Xb0M".to_owned();
let right = "Xb0M0V".to_owned();

// new key at beginning
let next = key_between(None, Some(&right))?;

// new key at end
let next = key_between(Some(&left), None)?;

// new key between 2 keys
let next = key_between(Some(&left), Some(&right))?;

License

TODO

Commit count: 0

cargo fmt