cached icon indicating copy to clipboard operation
cached copied to clipboard

Borrowed keys and values for `IOCached::set_cache`

Open 9999years opened this issue 1 year ago • 1 comments

Caching through an IO interface invariably requires serializing and deserializing the cached keys and values to bytes. This inherently requires duplicating the data, so it doesn't need owned access to the keys or values.

The interface to IOCached would require much less (unnecessary) cloning if the key and value parameters to set_cache were borrowed instead of owned.

9999years avatar Apr 06 '24 17:04 9999years

I have a draft implementation of this in #196. The interfaces themselves work fine but the macros are a bit more challenging. I think it'll need some massaging to make stuff like &str parameters work.

9999years avatar Apr 06 '24 17:04 9999years