1 unstable release

0.1.0 Feb 3, 2026

#267 in Caching

MIT license

7KB
69 lines

azcache

Unified cache backend for Redis and Memcached.

This crate provides a common interface for interacting with different cache backends, allowing you to switch between implementations without changing your application code.

Example

use azcache::{CacheBackend, CacheError, CacheResult};

struct MyCache;

impl CacheBackend for MyCache {
    fn get(&self, key: &str) -> CacheResult<Option<Vec<u8>>> {
        // Your implementation here
        Ok(None)
    }

    fn set(&self, key: &str, value: &[u8], ttl_seconds: Option<u64>) -> CacheResult<()> {
        // Your implementation here
        Ok(())
    }

    fn delete(&self, key: &str) -> CacheResult<bool> {
        // Your implementation here
        Ok(false)
    }

    fn exists(&self, key: &str) -> CacheResult<bool> {
        // Your implementation here
        Ok(false)
    }
}

azcache

Unified cache backend for Redis and Memcached.

Overview

azcache provides a unified interface for interacting with different cache backends, including Redis and Memcached. It allows you to switch between cache implementations without changing your application code.

Status

This crate is under active development. The API may change in future versions.

Features

  • Unified CacheBackend trait for cache operations
  • Support for multiple cache backends (Redis, Memcached)
  • Async-ready design
  • Simple and intuitive API

Installation

Add this to your Cargo.toml:

[dependencies]
azcache = "0.1"

Usage

use azcache::CacheBackend;

// Implement the CacheBackend trait for your preferred cache system

License

MIT License - see LICENSE for details.

No runtime deps