pub struct LightyVersionBuilder {
pub name: String,
pub server_url: String,
pub minecraft_version: Option<String>,
pub loader: Option<Loader>,
pub game_dirs: PathBuf,
pub java_dirs: PathBuf,
pub mod_requests: Vec<ModRequest>,
}Expand description
Builder for LightyUpdater-managed instances.
Unlike super::VersionBuilder, loader_version here holds the
LightyUpdater server URL: the actual loader and Minecraft version
are fetched from that server at install time. Default paths come
from the global AppState (call AppState::init first).
User-attached Modrinth / CurseForge mods can be layered on top of
the server-pushed metadata via with_mod. Modpacks are
intentionally not supported here — LightyUpdater is itself the
modpack source of truth, mixing in a second modpack would conflict
on the loader / Minecraft version.
Fields§
§name: String§server_url: String§minecraft_version: Option<String>§loader: Option<Loader>§game_dirs: PathBuf§java_dirs: PathBuf§mod_requests: Vec<ModRequest>Implementations§
Source§impl LightyVersionBuilder
impl LightyVersionBuilder
Sourcepub fn new(name: &str, server_url: &str) -> Self
pub fn new(name: &str, server_url: &str) -> Self
Creates a new LightyVersionBuilder.
server_url is the LightyUpdater server endpoint; the loader
and Minecraft version are resolved from its response at install
time. Panics if AppState::init hasn’t been called.
§Example
use lighty_core::AppState;
use lighty_version::LightyVersionBuilder;
AppState::init("MyLauncher").unwrap();
let builder = LightyVersionBuilder::new("my-server", "https://updater.example.com");Sourcepub fn with_mod(self) -> LightyModSourcesBuilder
pub fn with_mod(self) -> LightyModSourcesBuilder
Opens the user-mods sub-builder. Modpacks are not exposed on purpose — see the struct doc.
§Example
let builder = LightyVersionBuilder::new("server", "https://updater.example.com")
.with_mod()
.done();Trait Implementations§
Source§impl Clone for LightyVersionBuilder
impl Clone for LightyVersionBuilder
Source§fn clone(&self) -> LightyVersionBuilder
fn clone(&self) -> LightyVersionBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LightyVersionBuilder
impl Debug for LightyVersionBuilder
Source§impl<'b> VersionInfo for &'b LightyVersionBuilder
impl<'b> VersionInfo for &'b LightyVersionBuilder
type LoaderType = Loader
Source§fn loader_version(&self) -> &str
fn loader_version(&self) -> &str
LightyVersionBuilder).Source§fn minecraft_version(&self) -> &str
fn minecraft_version(&self) -> &str
Source§fn game_dirs(&self) -> &Path
fn game_dirs(&self) -> &Path
runtime/, libraries/,
assets/, .forge/ etc.).Source§fn loader(&self) -> &Self::LoaderType
fn loader(&self) -> &Self::LoaderType
Source§fn runtime_dir(&self) -> &Path
fn runtime_dir(&self) -> &Path
${game_directory} to the Minecraft client. Read moreSource§fn set_runtime_dir(&mut self, _path: PathBuf)
fn set_runtime_dir(&mut self, _path: PathBuf)
Source§fn game_dir_exists(&self) -> bool
fn game_dir_exists(&self) -> bool
Source§fn java_dir_exists(&self) -> bool
fn java_dir_exists(&self) -> bool
Source§fn full_identifier(&self) -> String
fn full_identifier(&self) -> String
Source§fn is_installed(&self) -> bool
fn is_installed(&self) -> bool
Source§impl VersionInfo for LightyVersionBuilder
impl VersionInfo for LightyVersionBuilder
type LoaderType = Loader
Source§fn loader_version(&self) -> &str
fn loader_version(&self) -> &str
LightyVersionBuilder).Source§fn minecraft_version(&self) -> &str
fn minecraft_version(&self) -> &str
Source§fn game_dirs(&self) -> &Path
fn game_dirs(&self) -> &Path
runtime/, libraries/,
assets/, .forge/ etc.).Source§fn loader(&self) -> &Self::LoaderType
fn loader(&self) -> &Self::LoaderType
Source§fn runtime_dir(&self) -> &Path
fn runtime_dir(&self) -> &Path
${game_directory} to the Minecraft client. Read moreSource§fn set_runtime_dir(&mut self, _path: PathBuf)
fn set_runtime_dir(&mut self, _path: PathBuf)
Source§fn game_dir_exists(&self) -> bool
fn game_dir_exists(&self) -> bool
Source§fn java_dir_exists(&self) -> bool
fn java_dir_exists(&self) -> bool
Source§fn full_identifier(&self) -> String
fn full_identifier(&self) -> String
Source§fn is_installed(&self) -> bool
fn is_installed(&self) -> bool
Source§impl<'b> WithMods for &'b LightyVersionBuilder
impl<'b> WithMods for &'b LightyVersionBuilder
Source§fn mod_requests(&self) -> &[ModRequest]
fn mod_requests(&self) -> &[ModRequest]
Source§impl WithMods for LightyVersionBuilder
impl WithMods for LightyVersionBuilder
Source§fn mod_requests(&self) -> &[ModRequest]
fn mod_requests(&self) -> &[ModRequest]
Auto Trait Implementations§
impl Freeze for LightyVersionBuilder
impl RefUnwindSafe for LightyVersionBuilder
impl Send for LightyVersionBuilder
impl Sync for LightyVersionBuilder
impl Unpin for LightyVersionBuilder
impl UnsafeUnpin for LightyVersionBuilder
impl UnwindSafe for LightyVersionBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InstanceCache for T
impl<T> InstanceCache for T
Source§async fn clear_cache(&self)
async fn clear_cache(&self)
(minecraft_version, loader).
Idempotent.