Crate yamemcache
source ·Expand description
Yet another memcached client
This is yet another memcached client since none of the existing ones at the same time:
- use a new version of tokio (1.x)
- allow access to flags when accessing the data
Example usage
#[tokio::main]
async fn main() {
let Ok(stream) = tokio::net::TcpStream::connect("127.0.0.1:11211").await
.map(tokio::io::BufStream::new) else {
println!("Unable to connect");
return;
};
let mut client = yamemcache::Client::new(stream);
if let Ok(x) = client.get("hello").await {
match x {
Some(x) => println!("Received data: {}", String::from_utf8_lossy(&x.data)),
None => println!("No data received"),
}
}
}
Modules
- Error return value
- Protocol implementation
Structs
- Memcached client abstraction
Traits
- Helper trait that combines all the required traits for the io