pub enum SystemArchitecture {
Show 16 variants
Aarch64,
Arm,
Armv6h,
Armv7h,
I386,
I486,
I686,
Loong64,
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!("{}", SystemArchitecture::from_str("custom_arch").unwrap())
);Variants§
Aarch64
ARMv8 64-bit
Arm
ARM
Armv6h
ARMv6 hard-float
Armv7h
ARMv7 hard-float
I386
Intel 386
I486
Intel 486
I686
Intel 686
Loong64
LoongArch 64-bit
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
Trait Implementations§
Source§impl AlpmParser for SystemArchitecture
impl AlpmParser for SystemArchitecture
Source§fn parser(input: &mut &str) -> ModalResult<SystemArchitecture>
fn parser(input: &mut &str) -> ModalResult<SystemArchitecture>
Recognizes a SystemArchitecture in an input string.
§Errors
Returns an error if input does not begin with a valid SystemArchitecture.
Source§impl Clone for SystemArchitecture
impl Clone for SystemArchitecture
Source§fn clone(&self) -> SystemArchitecture
fn clone(&self) -> SystemArchitecture
1.0.0 (const: unstable) · 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.
Source§impl Hash for SystemArchitecture
impl Hash for SystemArchitecture
Source§impl Ord for SystemArchitecture
impl Ord for SystemArchitecture
Source§fn cmp(&self, other: &SystemArchitecture) -> Ordering
fn cmp(&self, other: &SystemArchitecture) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SystemArchitecture
impl PartialEq for SystemArchitecture
Source§fn eq(&self, other: &SystemArchitecture) -> bool
fn eq(&self, other: &SystemArchitecture) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for SystemArchitecture
impl PartialOrd for SystemArchitecture
Source§impl Serialize for SystemArchitecture
impl Serialize for SystemArchitecture
Source§impl VariantNames for SystemArchitecture
impl VariantNames for SystemArchitecture
impl Eq for SystemArchitecture
impl StructuralPartialEq for SystemArchitecture
Auto Trait Implementations§
impl Freeze for SystemArchitecture
impl RefUnwindSafe for SystemArchitecture
impl Send for SystemArchitecture
impl Sync for SystemArchitecture
impl Unpin for SystemArchitecture
impl UnsafeUnpin for SystemArchitecture
impl UnwindSafe for SystemArchitecture
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U> ParserUntil for Uwhere
U: AlpmParser,
impl<U> ParserUntil for Uwhere
U: AlpmParser,
Source§fn parser_until<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses Self until the given delimiter parser
matches.
§Note
Does not consume the delimiter.
Source§fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
Source§impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
Source§fn parser_until_inclusive<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until_inclusive<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses the whole input and consumes the given delimiter parser.
Delegates to ParserUntil::parser_until and consumes the delimiter.