If someone is unfamiliar with memmap, they would need to learn how it works.
An additional point is that the memmap object might not even be required after the loading has occured. This is unsure, but if confirmed during testing, then &mut *mmap could be returned instead.
This Loader object will have the following functions:
copy_file simply copies the file, map_file_mut mutably memory maps the file into memory, returning the map, or a reference, and init_file_for_mut performs both functions at once.
If someone is unfamiliar with
memmap
, they would need to learn how it works.An additional point is that the
memmap
object might not even be required after the loading has occured. This is unsure, but if confirmed during testing, then&mut *mmap
could be returned instead.This
Loader
object will have the following functions:copy_file(from: String, to: String)
map_file_mut(name: String) -> MmapMut / &[u8]
init_file_for_mut(from: String, to:String) -> MmapMut / &[u8]
copy_file
simply copies the file,map_file_mut
mutably memory maps the file into memory, returning the map, or a reference, andinit_file_for_mut
performs both functions at once.