You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking about this. I think I might implement this as a generic type parameter. By default it will be an implementation that directly calls Duration/Instant but a user may optionally implement a struct that can mock it out.
Before I make my own trait, do you know of any good crates that define the abstraction? I'd rather just pull in something other people are already using.
As far as I undestand, TtlCache use
std::time::{Duration, Instant}
without any indirection layer.This makes it trickier to [unit-]test the code without waiting.
Shall there be some additional testing version of TtlCache that has overridable timer?
The text was updated successfully, but these errors were encountered: