How to Use lighty-version

Basic Usage

Step 1: Initialize AppState

use lighty_core::AppState;

const QUALIFIER: &str = "com";
const ORGANIZATION: &str = "MyLauncher";
const APPLICATION: &str = "";

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let _app = AppState::new(
        QUALIFIER.to_string(),
        ORGANIZATION.to_string(),
        APPLICATION.to_string(),
    )?;

    let launcher_dir = AppState::get_project_dirs();

    Ok(())
}

Step 2: Create VersionBuilder

VersionBuilder Features

Get Version Information

Output:

Custom Directories

Check Directory Existence

Get Both Directories

LightyVersionBuilder (Custom Server)

For custom servers using LightyUpdater:

Key Features:

Using with LoaderExtensions

Both builders implement VersionInfo, enabling all loader operations:

Using with InstanceControl

Both builders also support instance management:

Complete Workflow

Standard Loader Workflow

Custom Server Workflow

Directory Structure

Both builders create the following structure:

Exports

In lighty_version:

In lighty_launcher:

Last updated