Extensions to Sled for cache expiry, json storage
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Arlo (Hyena) bde9099ed3 Add Sync bound on error, also 3 weeks ago
src Add Sync bound on error, also 3 weeks ago
.gitignore Sled extensions for cache expiry, json storage 2 months ago
Cargo.toml Add Sync bound on error, also 3 weeks ago
LICENSE Bump sled, update license info 1 month ago
README.md Add Sync bound on error, also 3 weeks ago


Sled Extensions

Wrappers around the Sled embedded database to permit storing structured data

Using Sled Extensions is much like using Sled. The Tree API mirrors Sled’s directly, and the [Db] type is extended through traits.

use sled_extensions::{ConfigBuilder, Db, DbExt};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let db = Db::start(ConfigBuilder::default().temporary(true).build())?;
    let tree = db.open_json_tree::<usize>("json-tree")?;

    tree.insert(b"hey", 32)?;

    if let Some(num) = tree.get(b"hey")? {
        assert_eq!(num, 32);
    } else {
        unreachable!("Shouldn't be empty");


Available features

  • bincode - Enable storing bincode-encoded data
  • cbor - Enable storing cbor-encoded data
  • json - Enable storing json-encoded data


Unless otherwise stated, all contributions to this project will be licensed under the CSL with the exceptions listed in the License section of this file.


This work is licensed under the Cooperative Software License. This is not a Free Software License, but may be considered a “source-available License.” For most hobbyists, self-employed developers, worker-owned companies, and cooperatives, this software can be used in most projects so long as this software is distributed under the terms of the CSL. For more information, see the provided LICENSE file. If none exists, the license can be found online here. If you are a free software project and wish to use this software under the terms of the GNU Affero General Public License, please contact me at asonix@asonix.dog and we can sort that out. If you wish to use this project under any other license, especially in proprietary software, the answer is likely no.