-
Notifications
You must be signed in to change notification settings - Fork 26
open_stream
as mut
and read_stream
as non-mut
#38
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
base: master
Are you sure you want to change the base?
Conversation
This is a bit subtle. I agree that it's a little annoying that one currently can't read a stream while iterating over storage entries. The main issue here is that (assuming the underlying file type On the other hand, One solution might be to provide a new |
Just speaking for my use, I would be happy having separate Maybe an easy way to track their usage would be by keeping a
imho: I would be +1 on having separate types for reading and writing in some way - whether that's via a |
As a user of the library, I think I'd prefer to have a breaking change to the API that makes it safe and explicit about whether I can write, rather than having to just know not to call certain functions. I'm agreeing with @tgross35. |
Hi,
while trying to iterate over
read_root_storage
, I encountered thatopen_stream
borrows&mut self
and cannot be easily used with the immutable borrow ofread_root_storage
.Have you considered a
read_stream
that borrows immutable self? Is there a scenario where that wouldn't work?