-
Notifications
You must be signed in to change notification settings - Fork 10
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
introduce storage marker trait #10
Conversation
b7eeb87
to
0864733
Compare
Thanks for putting this together. I agree that the ability to corrupt the UTF-8 string is not great. However, one goal is to be able to be able to store any "byte container" in |
Thoughts @arthurprs @seanmonstar? |
Unfortunately, it seems that the marker trait is the least bad option here... What we probably can do is:
This would still allow for the unsafe constructor, which is an escape hatch to pass in types that don't implement Thoughts? |
Makes total sense -- just pushed an update that implements your suggestion. I've renamed the trait to |
I find unsafe impl string::Safe for MyBuffer {} unsafe impl string::StableAsRef for MyBuffer {} It's not so bad that I'd throw a fit, just though I'd add my 2 cents. |
Oh, yeah, no worries, I‘m totally happy to rename this to something else. If we think e.g. |
Sounds good to me 👍 |
Renamed to |
Thanks. Now the question is: Should |
It seems like it might be a good idea to have a dependency on the crate that is less likely to introduce breaking changes. Which one that is I don't know -- An alternative might be to move the trait into a separate crate that can be consumed from both, but I'm not sure that's worth it? |
@carllerche let me know if there's anything I can do to help get this over the line! |
Sorry for the delay |
Thanks for the PR and finding the issue 👍 |
This is exploring the use of a marker trait to address #9.