-
Notifications
You must be signed in to change notification settings - Fork 8
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
Somehow &[u8]
as Key?
#39
Comments
Hi there! I was meaning to keep the key simple. But having string support would be nice. If you see a way around this, I'd be interested to hear what your ideas are. Something that could be done that could be good enough is to just make the key variable length. That way one could efficiently store array strings in there. You'd get 99% of the benefits but 0% of the lifetime issues. |
Thanks for the quick response! Just aiming at array strings might be a good idea. Only (I'll actually be on vacation next week, don't expect progress before mid April.) |
Hi @kaspar030! What's the status on this? (Not trying to rush you, but at some point I'm gonna do it myself and it would be a waste of time if e.g. you were almost done already) |
I didn't get to work on this further, yet. Feel free to take over. :) Here is the branch where I hacked in, but I'd guess knowing the codebase would make you solve this differently. |
Thanks for the update! |
(Actually I want to use string literals, without going through a hasher.)
I don't mind using some more bytes for the Key, for my use case (some configuration values) a flash page is plenty.
I've looked into making
Key
support variable length types. It's doable (use a function forLEN
, ...).I stopped where the lifetimes show their head - in order to return slices,
Key::deserialize_from()
would need to carry a lifetime similar toValue
.What do you think? Would you be interested in a PR?
The text was updated successfully, but these errors were encountered: