supercache 0.1.0

Fastest cache
Documentation
  • Coverage
  • 40%
    4 out of 10 items documented4 out of 7 items with examples
  • Size
  • Source code size: 23.09 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.6 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • nnachonesa/supercache
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • nnachonesa

supercache

An cache that its fast - read docs for more info!

Struct

  • Vec of buckets (Vec<Vec<(K, V)>>)
  • Simple hash in bytes ASCII
  • colision manage by separate chaining

Features

  • Search and save by hash
  • Collision handling with buckets
  • Simple and readable code

Example

use supercache::Supercache;

fn main() {
    let mut cache = Supercache::new(None);
    map.set("cat", 1);
    map.set("dog", 2);

    println!("{:?}", map.get("dog"));
}

Methods

new(bucket_size)

Create new table

set(key, value)

Insert or overwrite an value

get(key)

Find an value by key.

delete(key)

Delete an element

clear()

Clear all buckets