openkache 0.1.0

Maintained Rust client for the OpenKache cache server
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Minimal Gate 0 client example.

use openkache::{Client, GetResult, SetOutcome, Value};

#[tokio::main]
async fn main() -> openkache::Result<()> {
    let client = Client::connect("127.0.0.1:4433").await?;
    let outcome = client.set("greeting", Value::text("hello")).await?;
    assert_eq!(outcome, SetOutcome::Created);
    assert_eq!(
        client.get("greeting").await?,
        GetResult::Found(Value::text("hello"))
    );
    client.close().await
}