by ComputerGuru · 2y ago · 0 comments
If I were to design this library, I would internally use an enum { Mapped(mmap), Direct(Box<[u8]>) } or better yet, delegate access and serialization/persistence to a trait so the type becomes BField<Impl> where the impl trait provides as_slice() and load()/save().
This way you abstract over the OS internals, provide a pure implementation for testing or no_std, and probably improve your codegen a bit.
No comments yet.