open_stream as mut and read_stream as non-mut#38
open_stream as mut and read_stream as non-mut#38smndtrl wants to merge 2 commits intomdsteele:masterfrom
open_stream as mut and read_stream as non-mut#38Conversation
|
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_streamborrows&mut selfand cannot be easily used with the immutable borrow ofread_root_storage.Have you considered a
read_streamthat borrows immutable self? Is there a scenario where that wouldn't work?