Crates.io | keyz_rust_client |
lib.rs | keyz_rust_client |
version | 1.0.5 |
source | src |
created_at | 2023-01-27 16:27:55.076429 |
updated_at | 2023-01-27 17:29:48.431984 |
description | keyz client for Rust |
homepage | |
repository | https://github.com/viktor111/keyz_rust_client.git |
max_upload_size | |
id | 769772 |
size | 9,480 |
Rust client for keyz
use keyz_rust_client::{ Keyz };
let keyz = Keyz::new("127.0.0.1".to_owned(), 7667).await;
test
and value is 1
let result = keyz.set("test", "1", None).await.unwrap();
test
and value is 1
with expiry time in seconds
let req = keyz.set("test", "1", Some(20)).await.unwrap();
test
let result = keyz.get("test").await.unwrap();
test
let result = keyz.delete("test").await.unwrap();
test
to expire
let result = keyz.expires_in("test").await.unwrap();
keyz.dispose().await.unwrap();
!!! Important make sure to dispose of connection when not needed anymore
let keyz = Keyz::new("127.0.0.1".to_owned(), 7667).await;
keyz.send_message("SET test 1").await.unwrap();
keyz.dispose().await.unwrap();
It is not advised to directly use this because some command currently are not fully supported with this method. You can learn more about all the commands in the keyz repo here