pub struct WorldsConfig {
pub save_path: String,
pub seed: Option<String>,
pub default_gamemode: Option<GameType>,
pub difficulty: Option<Difficulty>,
pub storage: Option<StorageSelection>,
pub player_storage: Option<StorageSelection>,
pub domains: BTreeMap<String, DomainConfig>,
}Expand description
Parsed worlds.toml root.
Fields§
§save_path: StringRoot directory for save data.
seed: Option<String>Root seed default. Empty or omitted means random.
default_gamemode: Option<GameType>Root default game mode for first-visit player data.
difficulty: Option<Difficulty>Root default difficulty for new level data.
storage: Option<StorageSelection>Root world storage default.
player_storage: Option<StorageSelection>Global player data storage selection.
domains: BTreeMap<String, DomainConfig>Domain declarations keyed by domain name.
Implementations§
Source§impl WorldsConfig
impl WorldsConfig
Sourcepub fn validate_and_resolve(
&self,
generator_registry: &WorldGeneratorRegistry,
storage_registry: &WorldStorageRegistry,
) -> Result<ResolvedWorldsConfig, String>
pub fn validate_and_resolve( &self, generator_registry: &WorldGeneratorRegistry, storage_registry: &WorldStorageRegistry, ) -> Result<ResolvedWorldsConfig, String>
Validates worlds.toml and resolves cascaded defaults.
§Errors
Returns a human-readable startup error if any invariant is violated.
Trait Implementations§
Source§impl Clone for WorldsConfig
impl Clone for WorldsConfig
Source§fn clone(&self) -> WorldsConfig
fn clone(&self) -> WorldsConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorldsConfig
impl Debug for WorldsConfig
Source§impl<'de> Deserialize<'de> for WorldsConfig
impl<'de> Deserialize<'de> for WorldsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WorldsConfig
impl RefUnwindSafe for WorldsConfig
impl Send for WorldsConfig
impl Sync for WorldsConfig
impl Unpin for WorldsConfig
impl UnsafeUnpin for WorldsConfig
impl UnwindSafe for WorldsConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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<>>