Caching 0.2.5

A Caching libary
Documentation
  • Coverage
  • 69.23%
    9 out of 13 items documented5 out of 12 items with examples
  • Size
  • Source code size: 11.07 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.64 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Benn1x/Caching
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Benn1x

Caching

how do you create a Cache?

use Caching;
fn main()->{
    // in this example we have an i32 where an String is linked to
    let cache = caching::Cache::<i32,String>::new(|a/* This is a lists<i32, String>*/|-> bool {return true});
    //                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    //                                              This is a lambda stored in the cache
    //it can be executed this way:
    cache.call();
    //to store values in the cache call:
    cache.insert(4,"4");
    // to get the value what is linked to 4 call:
    let example = cache.get(4);//returns Option enum with None if the value is not the cache and Some(), in this case Some("4")
}

Any questions open a Issue on Github