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

Can only store utf8 values using this crate? #63

Closed
andygrove opened this issue Jul 27, 2016 · 3 comments
Closed

Can only store utf8 values using this crate? #63

andygrove opened this issue Jul 27, 2016 · 3 comments

Comments

@andygrove
Copy link

I can write arbitrary byte values to the rocksdb store using the put() method but when I call get() I get a DBVector for the result, and I can see it has a to_utf8() method but I can't see how to get the raw bytes (my data is not utf8).

I'm still new to Rust and I tried calling the deref() method too, but couldn't see how to get that to work.

Would appreciate some pointers.

@andygrove
Copy link
Author

perhaps if deref() could be made public?

@spacejam
Copy link
Member

Hey @andygrove! Traits in rust become usable when you import them, so by importing the Deref trait you should have access to the underlying slice. You can then call .to_owned() on it if you want a Vec, I believe. Let me know if this isn't what you need, and we can improve the API!

@spacejam
Copy link
Member

Feel free to re-open if you have outstanding issues!

BusyJay pushed a commit to BusyJay/rust-rocksdb that referenced this issue Jul 7, 2017
BusyJay pushed a commit to BusyJay/rust-rocksdb that referenced this issue Jul 7, 2017
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

No branches or pull requests

2 participants