platform_lp/
architecture.rs

1use Platform;
2
3/// Architecture Partial, designed for 'fuzzy' comparisons.
4/// 
5/// ```rust
6/// use platform_lp::{ Platform, Architecture};
7/// 
8/// let the_platform = Platform::get_user_platform();
9/// # let the_platform = Platform::Win64;
10/// assert!(the_platform == Architecture::X64);
11#[derive(Debug,PartialEq,Hash,Eq)]
12pub enum Architecture {
13    X64,
14    X32,
15}
16
17impl PartialEq<Platform> for Architecture {
18    fn eq(&self, other: &Platform) -> bool {
19        match (self, other) {
20            (Architecture::X64, Platform::Nix64) => true,
21            (Architecture::X32, Platform::Nix32) => true,
22            (Architecture::X64, Platform::Win64) => true,
23            (Architecture::X32, Platform::Win32) => true,
24            (Architecture::X64, Platform::Mac64) => true,
25            (Architecture::X32, Platform::Mac32) => true,
26            (_,_) => false
27        }
28    }
29}