platform-lp

Crates.ioplatform-lp
lib.rsplatform-lp
version0.2.2
sourcesrc
created_at2018-12-14 15:13:20.725966
updated_at2018-12-22 19:11:49.926259
descriptiona library for getting the user platform, and checking against other platforms
homepage
repositoryhttps://github.com/snsvrno/platform-lp-rs
max_upload_size
id101892
size17,103
Snsvrno (snsvrno)

documentation

README

Platform-LP-RS

A platform enum written in rust to be used with lovepack tools.

Contains functions to determine the current running platform as well as parsing and comparisons.

Usage

Include the library in your cargo.toml.

[dependencies]
platform-lp = "0.2"

Then use it in your library / application.

let user_plat = platform_lp::Platform::get_user_platform();

// you can pass an entire executable name to check what platform it is, 
// assuming it goes by some kind of standard naming convention.
// like perhaps one of mine: lpsettings-0.1.7-win-x86_64.zip
let package_platform = platform_lp::Platform::new(executable_release_name);

// then you can check if its the same platform
if user_plat == package_platform {
    // then extract it, run it, etc ...
}

// or you can check compatability (i.e. for 32 bit on 64 bit systems)
if package_platform.is_compatible(user_plat) {
    // then do something fun...
}

Changes

0.2.1

  • Platform now implements std::fmt::Display
Commit count: 12

cargo fmt