Impl ops::Index with a move


I’m trying to implement a Map like API over some storage functions.
The struct it self has no data it just maps all the calls to disk directly.

I can’t seem to implement ops::Index as my struct returns the bytes loaded from disk with a move, it can’t return a reference because it doesn’t store anything.

   |         ||
   |         |temporary value created here
   |         returns a reference to data owned by the current function

Is there anyway to get the syntactic sugar of mymap[] without implementing ops::Index? or other alternatives?


No, there isn’t. The request is