r2d2-memcache

Crates.ior2d2-memcache
lib.rsr2d2-memcache
version0.6.0
sourcesrc
created_at2017-01-18 02:16:23.141135
updated_at2021-01-07 14:53:12.63247
descriptionMemcached support for the r2d2 connection pool
homepage
repositoryhttps://github.com/megumish/r2d2-memcache
max_upload_size
id8112
size3,304,713
AN Long (aisk)

documentation

README

r2d2-memcache

Build Status Latest Version Docs

Install

Add this to your Cargo.toml:

[dependencies]
r2d2-memcache = "0.2.0"

Basic Usage

extern crate r2d2_memcache;

fn main() {
    let manager = r2d2_memcache::MemcacheConnectionManager::new("memcache://localhost:11211");
    let pool = r2d2_memcache::r2d2::Pool::builder().max_size(15).build(manager).unwrap();

    let mut conn = pool.get().unwrap();
    conn.flush().unwrap();
    let value = "bar";
    conn.set("foo_get", value, 10).unwrap();
    let result: String = conn.get("foo_get").unwrap().unwrap();
    assert!(result == "bar");
}

License

Commit count: 45

cargo fmt