Closed samcday closed 8 months ago
Oh it's also worth noting that in no_std environment I had to explicitly bring in the memchr
crate, since core::slice::memchr
is unstable. I suppose object
could also do that when std feature is absent.
Does #653 meet your needs?
I suppose object could also do that when std feature is absent.
It already does. However, it also needs the hashbrown
crate, and I don't want that as a dependency all the time, so I added to no_std
feature to enable this.
This is wonderful. I've just tested with your branch and confirm it works exactly as I'd hoped. Thank you!
Hello! I'm using this wonderful crate in a no_std environment. In my particular case, I'm parsing UKI (PEs) files on an ESP (vfat) partition using the
fatfs
crate.fatfs
mainline branch works in no_std by simply defining their own variants ofstd::io::Read/Seek
traits: https://github.com/rafalh/rust-fatfs/blob/master/src/io.rs ... It's worth noting that the current latest published release depends on the now-defunct core_io crate.As it happens, I was able to get this working satisfactorily by simply duplicating the entirety of
ReadCache
+ReadCacheRange
, and updating theRead
+Seek
trait references fromstd::io
tofatfs
. The trait signatures are otherwise identical, so everything "just worked" without me needing to wrap my head around how I might implement such a thing myself.Which got me to thinking ... could the
object
crate do something similar? That is, exportobject::io::Read
+object::io::Seek
traits with some ergonomics to easily coercestd::io
variants (not sure how to do that off the top of my head, my Rust-fu is weak).