#key #lexicon #go #javascript #string #order #fractional-index

lexicon_fractional_index

Fractional index implementation migrated from Go/JavaScript

5 releases

0.0.4-a1 Jan 17, 2022
0.0.3 Dec 16, 2021
0.0.2 Dec 13, 2021
0.0.1 Dec 7, 2021

#5 in #lexicon

Download history 1232/week @ 2024-07-24 1153/week @ 2024-07-31 1360/week @ 2024-08-07 895/week @ 2024-08-14 1235/week @ 2024-08-21 850/week @ 2024-08-28 1142/week @ 2024-09-04 1358/week @ 2024-09-11 1141/week @ 2024-09-18 1104/week @ 2024-09-25 757/week @ 2024-10-02 484/week @ 2024-10-09 894/week @ 2024-10-16 553/week @ 2024-10-23 781/week @ 2024-10-30 608/week @ 2024-11-06

2,962 downloads per month

MIT license

13KB
280 lines

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

No runtime deps