remcached 0.3.0

Caching system designed for efficient storage and retrieval of entities from remote repositories (REST APIs, Database, ...etc)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::fmt::Display;
use std::future::Future;
use std::hash::Hash;

use crate::types::GenericError;

pub trait RCommands: Send + Sync
{
    type Key: Eq + Hash + Clone + Display + Send + Sync;
    type Value: Clone + Send + Sync;

    fn get(&self, key: &Self::Key) -> impl Future<Output=Result<Option<Self::Value>, GenericError>> + Send;
    fn put(&self, key: &Self::Key, value: &Self::Value) -> impl Future<Output=Result<(), GenericError>> + Send;
}