Migrating from 0.2 to 0.3
0.3 makes launcher futures usable from runtimes that require Send, such as
tokio::spawn, axum, and TUI kernels.
Launcher and drivers
| 0.2 | 0.3 |
|---|---|
Driver used #[async_trait(?Send)] |
Driver uses #[async_trait] and requires Send + Sync |
Custom drivers could store non-Send state |
Custom drivers and their sources must be Send + Sync |
Launcher async methods returned !Send futures |
Launcher async methods return Send futures |
Launcher::inspect_instances() returned Vec<Instance> and failed on any corrupt instance |
Returns InspectReport { instances, failures } so healthy instances remain usable |
MicrosoftAuthorizer<F> required a generic handler type |
MicrosoftAuthorizer stores a boxed handler; construct it with MicrosoftAuthorizer::new(...) |
Third-party Driver implementors only need to add Send + Sync bounds where
their state requires them; the trait methods themselves do not change.
Driver feature flags
driver-vanilla (and elemental-driver’s vanilla feature) has been removed.
Vanilla metadata is required by every loader and by the fallback path for
unmodded instances, so Vanilla is always compiled and always registered last.
Disable other drivers with their existing driver-* features; if a product
does not want to expose Vanilla in its UI, filter the descriptor list instead
of disabling the feature.
Driver module layout
Driver-internal type-alias modules and duplicate catalog aliases are removed. These paths are implementation details, but they were public and therefore require migration:
| Before 0.3 | 0.3 |
|---|---|
drivers::fabric::prepared::FabricRemoteResolver |
VanillaFallbackRemoteResolver<FabricEndpoints> |
drivers::quilt::prepared::QuiltRemoteResolver |
VanillaFallbackRemoteResolver<QuiltEndpoints> |
drivers::liteloader::prepared::LiteLoaderRemoteResolver |
VanillaFallbackRemoteResolver<LiteLoaderEndpoints> |
drivers::rift::prepared::RiftRemoteResolver |
VanillaFallbackRemoteResolver<RiftEndpoints> |
drivers::vanilla::prepared::ResolvedVanillaMetadata |
drivers::vanilla::ResolvedVanillaMetadata |
drivers::vanilla::prepared::ResolvedVanillaVersion |
drivers::vanilla::ResolvedVanillaVersion |
drivers::fabric::catalog::FabricCatalog |
drivers::fabric::FabricCatalog |
drivers::quilt::catalog::QuiltCatalog |
drivers::quilt::QuiltCatalog |
elemental_driver::catalog::LoaderMetaCatalog |
elemental_driver::families::version_json::LoaderMetaCatalog |
elemental_driver::catalog::InstallerMavenCatalog |
elemental_driver::families::installer::InstallerMavenCatalog |
elemental_driver::inspect::{InstanceProbe, InstalledInstance, InstanceDetectionFailure} |
elemental_driver::driver::{InstanceProbe, InstalledInstance, InstanceDetectionFailure} |
elemental_driver::families::version_json::inspect_instances |
elemental_driver::driver::inspect_instances |
elemental_driver::families::version_json::{ProfiledVersionJsonDriver, ProfiledVersionJsonFamily, ProfiledVersionJsonFamilyExt} |
elemental_driver::driver::{ProfiledVersionJsonDriver, ProfiledVersionJsonFamily, ProfiledVersionJsonFamilyExt} |
elemental_driver::families::installer::{InstallerFamilyDriver, ResolvedInstallerFamilyVersion} |
elemental_driver::driver::{InstallerFamilyDriver, ResolvedInstallerFamilyVersion} |
elemental_driver::families::installer::run_installer_client_processors(..., Option<&(dyn Fn(PrepareStage) + Send + Sync)>) |
Callback changed to Option<elemental_driver::families::installer::ProcessorObserver<'_>> (&(dyn Fn(usize, usize, &str) + Send + Sync)) |
Launcher variables
LauncherVariables now implements Clone. The JSON round-trip helpers
copy_with and copy_with_option are removed because callers can clone the
struct and assign its public fields directly.
| Before 0.3 | 0.3 |
|---|---|
variables.copy_with(key, value)? |
let mut copy = variables.clone(); copy.<field> = value; |
variables.copy_with_option(key, Some(value))? |
let mut copy = variables.clone(); copy.<field> = Some(value); |
variables.copy_with_option(key, None)? |
let mut copy = variables.clone(); copy.<field> = None; |
Catalog metadata
GameVersion and LoaderRelease no longer carry free-form description text.
Release channel metadata is named channel instead of stream.
| 0.2 | 0.3 |
|---|---|
GameVersion::description |
Removed; game versions only carry id and channel |
LoaderRelease::description |
Removed; use channel and other structured metadata |
LoaderRelease::with_description(...) |
Removed |
GameVersion::stream |
Renamed to GameVersion::channel |
LoaderRelease::stream |
Renamed to LoaderRelease::channel |
LoaderRelease::with_stream(...) |
Renamed to LoaderRelease::with_channel(...) |
Catalog descriptions were intended for human-facing text, but loader implementations used them for diagnostic provenance notes. The fields are removed so catalog metadata stays structured. Keep provenance notes in documentation or application-level UI instead.
Driver selection
DriverSpec is now a struct instead of an enum. VanillaSpec and LoaderSpec
are removed.
| Before 0.3 | 0.3 |
|---|---|
DriverSpec::Vanilla(spec) |
DriverSpec::vanilla(game_version) |
DriverSpec::Fabric(spec) / other loader variants |
DriverSpec::from_descriptor(descriptor, game_version, Some(loader_version)) |
DriverSpec::any(descriptor, game_version, loader_version) |
unchanged |
spec.descriptor() / .game_version() / .loader_version() |
unchanged |
elemental_launcher::VanillaSpec |
removed |
elemental_launcher::LoaderSpec |
removed |
Pattern matching over the old variants must be replaced with descriptor or accessor checks:
// Before 0.3
match spec {
DriverSpec::Fabric(loader) => use_loader(loader.loader_version),
DriverSpec::Vanilla(vanilla) => use_game(vanilla.game_version),
_ => {}
}
// 0.3
if spec.descriptor() == FABRIC_DRIVER {
use_loader(spec.loader_version().expect("fabric requires a loader version"));
} else if spec.descriptor() == VANILLA_DRIVER {
use_game(spec.game_version());
}
DriverSpec::from_descriptor rejects descriptors that are not enabled in the
current feature set, rejects a loader version for Vanilla, and requires a loader
version for every other driver.
Third-party drivers
0.3 adds an explicit registration path for drivers outside the built-in
ALL_DRIVERS set. Register the driver on the launcher, then use
DriverSpec::custom for requests:
use std::sync::Arc;
use elemental_driver::driver::DriverDescriptor;
use elemental_launcher::{DriverCatalog, DriverRegistration, DriverSpec, Launcher};
let descriptor = DriverDescriptor {
id: "my-loader",
name: "My Loader",
};
let registration = DriverRegistration::new(
descriptor,
Arc::new(MyDriver::new()),
DriverCatalog::loader(descriptor, MyCatalog::new()),
);
let launcher = Launcher::builder().build_with_drivers(vec![registration])?;
let spec = DriverSpec::custom(
descriptor,
game_version,
Some(loader_version),
);
let prepared = launcher.prepare(instance_name, spec, &runtime_options).await?;
Launcher::register_driver(...) is the post-build equivalent. Custom drivers
are inspected before built-ins, in registration order.
Every registration must provide a catalog. The catalog supplies game and loader versions for instance creation, while the driver supplies inspection and preparation behavior.
Discovery goes through the launcher registry, not a static driver list:
let descriptors = launcher.drivers().descriptors();
let catalog = launcher.drivers().catalog(descriptor)?;
DriverCatalog::supported_drivers() and DriverCatalog::for_driver() have been
removed. DriverCatalog is now only a catalog value; the registry decides which
drivers exist.
DriverSpec::from_descriptor keeps its closed-set validation for built-ins.
DriverSpec::custom trusts the caller and is resolved by the launcher’s
registration table. Registering a built-in descriptor or the same custom
descriptor twice returns Error::DriverAlreadyRegistered.
For custom catalogs, DriverCatalog::game_only(...) and
DriverCatalog::loader(...) are now public.
Instance probing
InstanceProbe::collect is now async and uses tokio::fs:
// Before 0.3
let probe = InstanceProbe::collect(&storage)?;
// 0.3
let probe = InstanceProbe::collect(&storage).await?;
Driver::inspect remains async; no trait change is required for custom drivers.
Shared and core encapsulation
| Before 0.3 | 0.3 |
|---|---|
elemental_shared::loader::Loader public fields (inner, migrator, persistor, target_version) |
Private; interact through Loader methods |
elemental_shared::loader::ProfileLoader |
Dedicated ProfileLoader struct in elemental_shared::profile |
elemental_shared::store::StoreLoader type alias for Loader |
Dedicated StoreLoader struct in elemental_shared::store |
elemental_core::runtime::provider::default_providers |
Moved to elemental_core::runtime::default_providers (runtime::providers::default_providers) |
ElementalDownloader::new() / ElementalDownloaderBuilder::build() returned Arc<ElementalDownloader> |
Returns ElementalDownloader directly (Clone, internally reference-counted); Launcher::downloader() returns &ElementalDownloader and LauncherBuilder::downloader(...) takes ElementalDownloader |
elemental_infra::downloader::{SessionId, TaskId} were u64 / String type aliases |
Dedicated Copy UUID newtypes (SessionId(Uuid) / TaskId(Uuid)) with Display, from_uuid, and as_uuid |