Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Borrowed keys and values for IOCached::set_cache #195

Open
9999years opened this issue Apr 6, 2024 · 1 comment · May be fixed by #196
Open

Borrowed keys and values for IOCached::set_cache #195

9999years opened this issue Apr 6, 2024 · 1 comment · May be fixed by #196

Comments

@9999years
Copy link
Contributor

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 9999years linked a pull request Apr 6, 2024 that will close this issue
@9999years
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant