pub struct WorldGeneratorRegistry {
factories: FxHashMap<Identifier, WorldGeneratorFactory>,
}Expand description
Registry of server-side world generator factories.
Fields§
§factories: FxHashMap<Identifier, WorldGeneratorFactory>Implementations§
Source§impl WorldGeneratorRegistry
impl WorldGeneratorRegistry
Sourcepub fn new_with_builtins() -> Result<Self, String>
pub fn new_with_builtins() -> Result<Self, String>
Creates a registry containing Steel’s built-in generator factories.
fn register( &mut self, key: Identifier, factory: WorldGeneratorFactory, ) -> Result<(), String>
Sourcepub fn validate_config(
&self,
key: &Identifier,
config: &Value,
) -> Result<ValidatedWorldGeneratorConfig, String>
pub fn validate_config( &self, key: &Identifier, config: &Value, ) -> Result<ValidatedWorldGeneratorConfig, String>
Parses and validates config for a generator ID.
Sourcepub fn create(
&self,
world_path: Option<&Path>,
config: &ValidatedWorldGeneratorConfig,
seed: i64,
thread_pool: Arc<ThreadPool>,
) -> Result<GeneratorOutput, String>
pub fn create( &self, world_path: Option<&Path>, config: &ValidatedWorldGeneratorConfig, seed: i64, thread_pool: Arc<ThreadPool>, ) -> Result<GeneratorOutput, String>
Creates a generator from a validated generator ID and config.
Auto Trait Implementations§
impl Freeze for WorldGeneratorRegistry
impl RefUnwindSafe for WorldGeneratorRegistry
impl Send for WorldGeneratorRegistry
impl Sync for WorldGeneratorRegistry
impl Unpin for WorldGeneratorRegistry
impl UnsafeUnpin for WorldGeneratorRegistry
impl UnwindSafe for WorldGeneratorRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>