Trait fastanvil::RegionLoader[][src]

pub trait RegionLoader<C: Chunk>: Send + Sync {
    fn region(&self, x: RCoord, z: RCoord) -> Option<Box<dyn Region<C>>>;
fn list(&self) -> LoaderResult<Vec<(RCoord, RCoord)>>; }
Expand description

RegionLoader implmentations provide access to regions. They do not need to be concerned with caching, just providing an object that implements Region.

An example implementation could be loading a region file from a local disk, or perhaps a WASM version loading from a file buffer in the browser.

Required methods

Get a particular region. Returns None if region does not exist.

List the regions that this loader can return. Implmentations need to provide this so that callers can efficiently find regions to process.

Implementors