1#[derive(Clone, Copy, Debug, Eq, PartialEq)]
3pub enum Architecture {
4 Arm64,
6 X86_64,
8}
9
10impl Architecture {
11 pub fn current() -> Option<Self> {
13 match std::env::consts::ARCH {
14 "aarch64" => Some(Self::Arm64),
15 "x86_64" => Some(Self::X86_64),
16 _ => None,
17 }
18 }
19
20 pub const fn rust(self) -> &'static str {
22 match self {
23 Self::Arm64 => "aarch64",
24 Self::X86_64 => "x86_64",
25 }
26 }
27
28 pub const fn apple(self) -> &'static str {
30 match self {
31 Self::Arm64 => "arm64",
32 Self::X86_64 => "x86_64",
33 }
34 }
35
36 pub const fn debian(self) -> &'static str {
38 match self {
39 Self::Arm64 => "arm64",
40 Self::X86_64 => "amd64",
41 }
42 }
43}