pub trait RegionLoader<S>where
    S: Seek + Read + Write,{
    // Required methods
    fn region(&self, x: RCoord, z: RCoord) -> LoaderResult<Option<Region<S>>>;
    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§

source

fn region(&self, x: RCoord, z: RCoord) -> LoaderResult<Option<Region<S>>>

Get a particular region. Returns Ok(None) if region does not exist.

source

fn list(&self) -> LoaderResult<Vec<(RCoord, RCoord)>>

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

Implementors§