Open DrSensor opened 9 months ago
Thanks for the PR! This is possible, if not a bit unconventional, because you can of course already read with read()
but still ok.
However, I think this needs tests. Especially this should have a test where you first create a sparse file (with a large enough deleted section that a hole is actually created) and then take out this BufReader and read over the hole. It most likely does work and gives zeroes, but should IMO still be verified.
Choose one: is this a 🐛 bug fix, a 🙋 feature, or a 🔦 documentation change? 🙋 feature
Checklist
Context
I have a case where I store RandomAccessDisk in struct like this
It's quite common to do buffered read so I expose
reader()
method. Accessing the underlyingfs::File
is possible by callingreader().get_ref()
orreader().get_mut()
.The
reader()
method open up the possibility for this patternSemver Changes
3.1.0