Mutable On-Disk Data Structure for Ordered Data

I'm writing a CLI that manages an ordered list of elements. I want a data structure that provides efficient (log(n)) insertion, deletion, find-next, and find-previous queries. Each CLI operation will only perform a small number of queries, so I want a data structure that can live on disk and be queried (including edited) without loading the whole structure.

Is there an existing crate that does this?

That's called a "database". Usually implemented using some variation on the classic B-tree data structure.

Just use SQLite.

6 Likes
3 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.