I just tried out the lru_disk_cache crate because it sounds like it does what I want. However, one can easily corrupt files with it, but this behavior is not documented at all and the type system does not enforce anything.
First of all insert_file silently moves that file into the cache. In other words, it deletes the original. And the documentation does not spare one word on it.
The second issue is, that when using an absolute path as key, it will silently overwrite random files on the file system (outside of the cache). The content of the keys is never checked nor enforced. And I couldn't find any documentation on this either.
I just tried out the
lru_disk_cachecrate because it sounds like it does what I want. However, one can easily corrupt files with it, but this behavior is not documented at all and the type system does not enforce anything.First of all
insert_filesilently moves that file into the cache. In other words, it deletes the original. And the documentation does not spare one word on it.The second issue is, that when using an absolute path as key, it will silently overwrite random files on the file system (outside of the cache). The content of the keys is never checked nor enforced. And I couldn't find any documentation on this either.