Crate platform_lp

Source
Expand description

§Platform-lp

A crate for easily determining the user’s platform at runtime and comparision of platforms.

Platform-lp is made up of an enum, Platform which can be used to determine what platform a user is running, what platform other tools or binaries might be and then compare the two to find the right object for your user based on their current running platform.

Currently supports the following platforms

  • Win64
  • Win32
  • Linux64
  • Linux32
  • MacOS64
  • MacOS32

And has Partials to allow for matching only the OS and Architecture

  • Windows
  • Linux
  • Mac
  • X32
  • X64

§Example

use platform_lp::{ PartialPlatform, Platform, Architecture};
 
let the_platform = Platform::get_user_platform();
 
 
assert!(the_platform == PartialPlatform::Windows);
assert!(the_platform == Architecture::X64);
 

Enums§

Architecture
Architecture Partial, designed for ‘fuzzy’ comparisons.
PartialPlatform
Platform Partial, designed for ‘fuzzy’ comparisons.
Platform
Platform struct, designed to completely describe the current platform or other possible platforms.