al8n / stretto

Stretto is a Rust implementation for Dgraph's ristretto (https://github.com/dgraph-io/ristretto). A high performance memory-bound Rust cache.
Apache License 2.0
412 stars 28 forks source link

[feature] Getting TTL value of entry #17

Closed ClSlaid closed 2 years ago

ClSlaid commented 2 years ago

proposing a new method that gets ttl value of an entry.

let val_ref = cache.get(&key).unwrap();
let ttl: std::time::Duration = val_ref.ttl();
let value = val_ref.value();
al8n commented 2 years ago

Hi @ClSlaid, I am busy in recent weeks, I may have a look this weekend if I have time, would you like to help implement this feature?

ClSlaid commented 2 years ago

Hi @ClSlaid, I am busy in recent weeks, I may have a look this weekend if I have time, would you like to help implement this feature?

It's pretty hard, so many generic quotes go bruhhhh...

I'll see what I can do...