rust-memcache
rust-memcache is a Memcached client written in pure rust.
Install:
The crate is called memcache
and you can depend on it via cargo:
[dependencies]
memcache = "*"
Features:
- ASCII protocal
- Binary protocal
- TCP connection
- UDP connection
- UNIX Domain socket connection
- Automatically compress
- Automatically serialize to JSON / msgpack etc.
- Typed interface
- Mutiple server support with custom key hash algorithm
Basic usage:
// create connection
let mut conn = connect.unwrap;
// flush the database
conn.flush.unwrap;
// set a string value
conn.set.unwrap;
// retrieve from memcached
let value: String = conn.get.unwrap;
assert!;
// set a int value
conn.set.unwrap;
// increment it atomic
conn.incr;
// retrieve it as i32
let value: i32 = conn.get.unwrap;
assert!;
License
MIT