owengage / fastnbt

Fast serde serializer and deserializer for Minecraft's NBT and Anvil formats
MIT License
185 stars 34 forks source link

Use callback based iteration #5

Closed mdornseif closed 4 years ago

mdornseif commented 4 years ago

With https://github.com/owengage/fastnbt/commit/93cb55687ea4c08ca768be6f840784eeedbf4c7b in master anvil/draw.rs can be slimmed down a bit. Not sure If you want to use this:

Before I implemented the callback based interface I tried an iterator but I was not RUSTy enough to implement it with the generic Type Region. But still I think some way to access all chunks should be part of the core module functionality and not of the draw.rs part.

owengage commented 4 years ago

My first thought would have been an iterator, but I can ssee how that might get messy. I'll go for this and maybe have a look at the iterator approach some time.