keyz_rust_client
Rust client for keyz
Getting started
- Import
use ; - Initialize the connection to running keyz server
let keyz = new.await; - Set value where key is
testand value is1let result = keyz.set.await.unwrap; - Set value where key is
testand value is1with expiry time in secondslet req = keyz.set.await.unwrap; - Get value with key
testlet result = keyz.get.await.unwrap; - Delete value with key
testlet result = keyz.delete.await.unwrap; - Get the time left for the key
testto expirelet result = keyz.expires_in.await.unwrap; - Dispose connection
keyz.dispose.await.unwrap;
!!! Important make sure to dispose of connection when not needed anymore
Using direct send message
let keyz = new.await;
keyz.send_message.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