pub trait LevelGenerator {
// Required method
fn generate(
&mut self,
info: ChunkLoadRequest,
) -> Result<ProtoChunk, (LevelSourceError, ChunkLoadRequest)>;
}Expand description
A trait to implement for level generators, this trait provides a synchronous method to
generate a specific chunk. This trait is not valid for methods expecting a LevelSource,
to do this you need to wrap it into LevelGeneratorSource, this structure will clone your
generator in any given workers count and run them asynchronously.
Required Methods§
fn generate( &mut self, info: ChunkLoadRequest, ) -> Result<ProtoChunk, (LevelSourceError, ChunkLoadRequest)>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".