sievecache ~main

A SIEVE Cache implementation in D


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

SIEVE Cache in D

An implementation of the SIEVE Cache eviction algorithm for D. This implementation is fully inspired by Rust's sieve-cache implementation.

Usage

import sievecache;

import std.stdio;

void main()
{
    auto cache = SieveCache!(string, string)(10_000);

    cache["foo"] = "foocontent";
    cache["bar"] = "barcontent";
    cache.remove("bar");

    writeln(cache["foo"]);           // "foocontent"
    writeln(!cache.contains("bar")); // false
    writeln(cache.length);           // 1
    writeln(cache.capacity);         // 10000
}

Development

Testing

dub test

Lint

dub lint

Serve the docmentation on a local server

dub run -b ddox
Authors:
  • Hiroki Noda
Dependencies:
none
Versions:
0.4.0 2024-May-30
0.3.1 2024-May-20
0.3.0 2024-May-19
0.2.1 2024-May-18
0.2.0 2024-May-16
Show all 8 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 5 downloads total

Score:
0.2
Short URL:
sievecache.dub.pm