#[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 Clone for Architecture
impl Clone for Architecture
source§fn clone(&self) -> Architecture
fn clone(&self) -> Architecture
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§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 Ord for Architecture
impl Ord for Architecture
source§fn cmp(&self, other: &Architecture) -> Ordering
fn cmp(&self, other: &Architecture) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for Architecture
impl PartialEq for Architecture
source§impl PartialOrd for Architecture
impl PartialOrd for Architecture
source§impl TryFrom<&str> for Architecture
impl TryFrom<&str> for Architecture
impl Copy for Architecture
impl Eq for Architecture
impl StructuralPartialEq for Architecture
Auto Trait Implementations§
impl Freeze for Architecture
impl RefUnwindSafe for Architecture
impl Send for Architecture
impl Sync for Architecture
impl Unpin for Architecture
impl UnwindSafe for Architecture
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)