4 releases

0.1.3 Dec 26, 2019
0.1.2 Dec 21, 2019
0.1.1 Dec 15, 2019
0.1.0 Dec 14, 2019

#241 in #binding

BSD-3-Clause

13KB
281 lines

Twinkle

Binding of Twinkle for Rust.

Actions Status twinkle at crates.io twinkle at docs.rs

Usage

Cargo.toml

[dependencies]
twinkle = "0.1"
futures = "0.3"
tokio = { version = "0.2", features = ["full"] }

main.rs

use futures::future::{join};

#[tokio::main]
async fn main(){
    let (client, manager) = twinkle::open("127.0.0.1:3000").await.unwrap();
    join(manager.run(), your_app(client));
}

async fn your_app(mut c: twinkle::Client) {
    c.ping().await;
    c.set(b"hoge".to_vec(), b"foo".to_vec()).await;
    c.get(b"hoge".to_vec()).await;
    c.unset(b"hoge".to_vec()).await;
}

License

BSD-3-Clause

Dependencies

~5MB
~73K SLoC