pub enum SystemArchitecture {
Show 15 variants
Aarch64,
Arm,
Armv6h,
Armv7h,
I386,
I486,
I686,
Pentium4,
Riscv32,
Riscv64,
X86_64,
X86_64V2,
X86_64V3,
X86_64V4,
Unknown(UnknownArchitecture),
}Expand description
Specific CPU architecture
Can be either a known variant or an unknown architecture represented as a case-insensitive string, that:
- consists only of ASCII alphanumeric characters and underscores
- is not “any”
Members of the SystemArchitecture enum can be created from &str.
§Examples
use std::str::FromStr;
use alpm_types::{SystemArchitecture, UnknownArchitecture};
// create SystemArchitecture from str
assert_eq!(
SystemArchitecture::from_str("aarch64"),
Ok(SystemArchitecture::Aarch64)
);
// format as String
assert_eq!("x86_64", format!("{}", SystemArchitecture::X86_64));
assert_eq!(
"custom_arch",
format!("{}", UnknownArchitecture::new("custom_arch")?)
);Variants§
Aarch64
ARMv8 64-bit
Arm
ARM
Armv6h
ARMv6 hard-float
Armv7h
ARMv7 hard-float
I386
Intel 386
I486
Intel 486
I686
Intel 686
Pentium4
Intel Pentium 4
Riscv32
RISC-V 32-bit
Riscv64
RISC-V 64-bit
X86_64
Intel x86_64
X86_64V2
Intel x86_64 version 2
X86_64V3
Intel x86_64 version 3
X86_64V4
Intel x86_64 version 4
Unknown(UnknownArchitecture)
Unknown architecture
Implementations§
Source§impl SystemArchitecture
impl SystemArchitecture
Sourcepub fn parser(input: &mut &str) -> ModalResult<SystemArchitecture>
pub fn parser(input: &mut &str) -> ModalResult<SystemArchitecture>
Recognizes a SystemArchitecture in an input string.
Consumes all input and returns an error if the string doesn’t match any architecture.
Trait Implementations§
Source§impl Clone for SystemArchitecture
impl Clone for SystemArchitecture
Source§fn clone(&self) -> SystemArchitecture
fn clone(&self) -> SystemArchitecture
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SystemArchitecture
impl Debug for SystemArchitecture
Source§impl<'de> Deserialize<'de> for SystemArchitecture
impl<'de> Deserialize<'de> for SystemArchitecture
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for SystemArchitecture
impl Display for SystemArchitecture
Source§impl From<SystemArchitecture> for Architecture
impl From<SystemArchitecture> for Architecture
Source§fn from(value: SystemArchitecture) -> Self
fn from(value: SystemArchitecture) -> Self
Converts a SystemArchitecture into an Architecture.
Source§impl From<UnknownArchitecture> for SystemArchitecture
impl From<UnknownArchitecture> for SystemArchitecture
Source§fn from(value: UnknownArchitecture) -> Self
fn from(value: UnknownArchitecture) -> Self
Converts an UnknownArchitecture into a SystemArchitecture.
Source§impl FromStr for SystemArchitecture
impl FromStr for SystemArchitecture
Source§fn from_str(s: &str) -> Result<SystemArchitecture, Self::Err>
fn from_str(s: &str) -> Result<SystemArchitecture, Self::Err>
Creates a SystemArchitecture from a string slice.
Delegates to SystemArchitecture::parser.
§Errors
Returns an error if SystemArchitecture::parser fails.