use-cache-store 0.1.0

Cache store modeling primitives for RustUse
Documentation
  • Coverage
  • 71.43%
    35 out of 49 items documented1 out of 34 items with examples
  • Size
  • Source code size: 10.95 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.04 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-nosql
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-cache-store

Cache store modeling primitives for RustUse.

Experimental

use-cache-store is experimental while use-nosql remains below 0.3.0.

Example

use use_cache_store::{CacheEntry, CacheKey, CacheNamespace, CacheValue, Ttl};

let key = CacheKey::builder()
    .namespace(CacheNamespace::new("reviews"))
    .segment("summary")
    .build();
let entry = CacheEntry::new(key, CacheValue::new("cached")).with_ttl(Ttl::seconds(60)?);

assert_eq!(entry.ttl().map(Ttl::duration).unwrap().as_secs(), 60);
# Ok::<(), use_cache_store::InvalidTtlError>(())

Scope

  • Cache key, namespace, value, entry, TTL, expiration, status, and eviction labels.
  • Simple key composition primitives.

Non-goals

  • Redis or Memcached clients.
  • Network calls.
  • Cache invalidation engines.

License

Licensed under either Apache-2.0 or MIT.