> Anyway, on my personal wishlist: Allow customized pointers.
It's already there isn't it? Isn't a custom pointer just a stack struct implementing Deref (and possibly DerefMut)?
I think this can be implemented on current Rust, although you will have to define specific array, list and sets for this situation.
However, you would probably want a different implementation anyway due to the different performance characteristics of disk/SSD vs RAM.
That's a rather difficult sort of generic type to implement: it would have to include the base address in the type somehow.
Re:My gamedever wishlist for Rust
by JoeAltmaier on Thursday October 01, 2015 @11:28AM
(#10311803)
Construct ptrs with the base address? At that point, why not just use '+' and be done with it.
Can't you use raw pointers and .offset()? You can put them in a struct that mutates itself for every method call so it keeps track of the mmap. You'd also probably have to make sure that it has exclusive access to the mmap so another thread won't invalidate its pointers.
Anyway, on my personal wishlist: Allow customized pointers. For example, if I use a mmapped file that is mapped at a different base address every time it is opened, the pointers within that file are always relative to the base address. I'd like to use "special" pointers inside the mmapped file, that are aware of this. Also, I'd like to use standard data structures (associative arrays, lists, sets) inside the mmapped file, meaning that the solution should be generic.