Function edjx::kv::put

source ·
pub fn put<K, V>(key: K, val: V, ttl: Option<Duration>) -> Result<(), KVError>where
    K: AsRef<str>,
    V: AsRef<[u8]>,
Expand description

Inserts a key-value pair into the KV store.

Example

let some_key = "some_key".to_owned();
let some_value = "some_value".to_owned();

let operation_success : bool = match kv::put(&some_key, some_value, Some(Duration::from_secs(1000 * 5 * 60))) {
    Err(_) => false,
    Ok(_) => true,
}