I've published my first Crate! rollgrid, a library for 2d and 3d pseudo-infinite worlds.
Link: https://crates.io/crates/rollgrid
I've worked hard on this crate, and I'm releasing it today!
It can be used to make scrolling tilemaps, or even scrolling 3D chunked worlds. I made it specifically for a voxel game I was fiddling around with, but I'm sure there are other uses for it.
There's RollGrid2D for 2D (sc)rolling grids, or RollGrid3D for 3D (sc)rolling grids.
When a grid is repositioned, none of the cells are moved around in memory. Instead, a lookup offset is modified to allow for the illusion that the grid has been moved. There is functionality that allows you to reposition and resize the grid, with callbacks that either unload, load, or reload cells.
For design resigns, the cells are stored as Option<T>. You're free to fork the repo and try to change this design decision, but at the time of creation, it just made sense.
The callbacks for loading/unloading/reloading take a functional approach where the cell that is being changed is passed to the callback, and the callback is expected to return the modified/new cell that should be in the new position.
If anyone has any questions, ask away.