| Crates.io | lighty-core |
| lib.rs | lighty-core |
| version | 0.8.6 |
| created_at | 2025-12-02 11:08:20.033769+00 |
| updated_at | 2025-12-14 07:25:53.798561+00 |
| description | Core utilities for Lighty Launcher |
| homepage | https://github.com/Lighty-Launcher/LightyLauncherLib |
| repository | https://github.com/Lighty-Launcher/LightyLauncherLib |
| max_upload_size | |
| id | 1961610 |
| size | 96,524 |
Core utilities for LightyLauncher.
This is an internal crate for the LightyLauncher ecosystem. Most users should use the main lighty-launcher crate instead.
[dependencies]
lighty-core = "0.6.3"
use lighty_core::download::download_file;
use lighty_core::system::{get_os, get_architecture};
#[tokio::main]
async fn main() {
// Detect system
let os = get_os();
let arch = get_architecture();
println!("Running on {:?} {:?}", os, arch);
// Download file
let path = download_file(
"https://example.com/file.zip",
"/tmp/file.zip",
Some("expected-sha1-hash")
).await?;
}
lighty-core/
└── src/
├── lib.rs # Module declarations and re-exports
├── download.rs # Async file downloads with SHA1 verification
├── extract.rs # Archive extraction (ZIP, TAR, TAR.GZ)
├── system.rs # OS and architecture detection
├── hosts.rs # HTTP client with custom user agent
├── hash.rs # Hash utilities (SHA1, SHA256 verification)
├── errors.rs # Error types (DownloadError, ExtractError, SystemError)
└── macros.rs # Utility macros
download - Async file downloads with retry logic and SHA1 verificationextract - Archive extraction for ZIP, TAR, and TAR.GZ formatssystem - Cross-platform OS and architecture detectionhosts - Shared HTTP client with appropriate user agenterrors - Comprehensive error types with thiserrormacros - Utility macros for common patternsMIT