Enum alpm_types::Architecture
source · #[non_exhaustive]
pub enum Architecture {
Show 14 variants
Aarch64,
Any,
Arm,
Armv6h,
Armv7h,
I486,
I686,
Pentium4,
Riscv32,
Riscv64,
X86_64,
X86_64V2,
X86_64V3,
X86_64V4,
}Expand description
CPU architecture
Members of the Architecture enum can be created from &str.
Examples
use std::str::FromStr;
use alpm_types::Architecture;
// create Architecture from str
assert_eq!(Architecture::from_str("aarch64"), Ok(Architecture::Aarch64));
// format as String
assert_eq!("aarch64", format!("{}", Architecture::Aarch64));
assert_eq!("any", format!("{}", Architecture::Any));
assert_eq!("arm", format!("{}", Architecture::Arm));
assert_eq!("armv6h", format!("{}", Architecture::Armv6h));
assert_eq!("armv7h", format!("{}", Architecture::Armv7h));
assert_eq!("i486", format!("{}", Architecture::I486));
assert_eq!("i686", format!("{}", Architecture::I686));
assert_eq!("pentium4", format!("{}", Architecture::Pentium4));
assert_eq!("riscv32", format!("{}", Architecture::Riscv32));
assert_eq!("riscv64", format!("{}", Architecture::Riscv64));
assert_eq!("x86_64", format!("{}", Architecture::X86_64));
assert_eq!("x86_64_v2", format!("{}", Architecture::X86_64V2));
assert_eq!("x86_64_v3", format!("{}", Architecture::X86_64V3));
assert_eq!("x86_64_v4", format!("{}", Architecture::X86_64V4));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Trait Implementations§
source§impl Debug for Architecture
impl Debug for Architecture
source§impl Display for Architecture
impl Display for Architecture
source§impl FromStr for Architecture
impl FromStr for Architecture
source§impl PartialEq<Architecture> for Architecture
impl PartialEq<Architecture> for Architecture
source§fn eq(&self, other: &Architecture) -> bool
fn eq(&self, other: &Architecture) -> bool
This method tests for
self and other values to be equal, and is used
by ==.