pub enum KnownArch {
Show 18 variants
Arm,
AArch64,
X86,
X86_64,
Riscv32,
Riscv64,
Powerpc,
Powerpc64,
Mips,
Mips64,
Sparc,
Sparc64,
S390x,
M68k,
LoongArch64,
Alpha,
Hppa,
Ia64,
}Expand description
A CPU architecture officially supported by Gentoo Linux.
Represents the 18 architectures with stable or testing keywords in the
Gentoo ebuild repository. Each variant maps to a canonical Gentoo keyword
string via KnownArch::as_keyword.
§Keyword Grouping
Some architectures share keywords due to Gentoo’s keyword conventions:
| Architecture | Keyword | Notes |
|---|---|---|
Riscv32, Riscv64 | "riscv" | RISC-V variants share a keyword |
Mips, Mips64 | "mips" | MIPS variants share a keyword |
Sparc, Sparc64 | "sparc" | SPARC variants share a keyword |
§Examples
use gentoo_core::KnownArch;
let arch: KnownArch = "amd64".parse().unwrap();
assert_eq!(arch.as_keyword(), "amd64");
assert_eq!(arch.bitness(), 64);Variants§
Arm
AArch64
X86
X86_64
Riscv32
Riscv64
Powerpc
Powerpc64
Mips
Mips64
Sparc
Sparc64
S390x
M68k
LoongArch64
Alpha
Hppa
Ia64
Implementations§
Source§impl KnownArch
impl KnownArch
Sourcepub fn as_keyword(&self) -> &'static str
pub fn as_keyword(&self) -> &'static str
Gentoo keyword string for this architecture (e.g. "amd64").
Sourcepub fn parse(arch: &str) -> Result<Self, Error>
pub fn parse(arch: &str) -> Result<Self, Error>
Parse from a keyword or common alias string (case-insensitive).
Sourcepub fn current() -> Result<Self, Error>
pub fn current() -> Result<Self, Error>
Current system architecture from std::env::consts::ARCH.
Trait Implementations§
impl Copy for KnownArch
impl Eq for KnownArch
impl StructuralPartialEq for KnownArch
Auto Trait Implementations§
impl Freeze for KnownArch
impl RefUnwindSafe for KnownArch
impl Send for KnownArch
impl Sync for KnownArch
impl Unpin for KnownArch
impl UnsafeUnpin for KnownArch
impl UnwindSafe for KnownArch
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