memcache-async

Build Status Codecov Status Crates.io MIT licensed Docs

memcache-async is an async memcached client implementation.

Install

The crate is called memcache-async and you can depend on it via cargo:

ini [dependencies] memcache-async = "*"

Features

The crate implements the protocol on any stream implementing AsyncRead + AsyncWrite.

Basic usage

The crate works with byte slices for values, the caller should implement deserialization if desired.

```rust use tokio::prelude::*; use tokio::await; use tokio::net::UnixStream; use memcache_async::ascii;

tokio::run_async(async move { let sock = await!(UnixStream::connect("memcache.sock")).expect("connected socket"); let mut ascii = ascii::Protocol::new(sock);

// set a value
await!(ascii.set(&"foo", b"bar", 0)).expect("set works");

// retrieve 
let value = await!(ascii.get(&"foo")).expect("get works");
assert_eq!(value, b"bar".to_vec());

}); ```

License

MIT