# gentoo-core
[](LICENSE)
[](https://crates.io/crates/gentoo-core)
[](https://docs.rs/gentoo-core)
[](LICENSE)
[](https://github.com/lu-zero/gentoo-core/actions/workflows/ci.yml)
[](https://codecov.io/github/lu-zero/gentoo-core)
Core Gentoo types and utilities for Rust applications.
## Overview
`gentoo-core` provides fundamental Gentoo-specific types and utilities that can be used across various Gentoo-related Rust projects.
## Features
- Gentoo architecture representation and parsing
- Variant configuration for Gentoo systems
## Architecture Support
The crate supports the following Gentoo architectures:
- `arm`, `aarch64` (arm64)
- `x86`, `amd64` (x86_64)
- `riscv`, `riscv64`
- `powerpc`, `ppc64`
- And their Gentoo keyword equivalents
## Installation
Add to your `Cargo.toml`:
```toml
[dependencies]
gentoo-core = "0.3"
```
## Usage
```rust
use gentoo_core::{Arch, Variant, KnownArch};
// Parse a known architecture
let known = KnownArch::parse("amd64").unwrap();
println!("Known: {} (keyword: {}, bitness: {})", known, known.as_keyword(), known.bitness());
// Intern an architecture (known or exotic)
let arch = Arch::intern("amd64");
println!("Arch: {} (keyword: {})", arch, arch.as_keyword());
// Exotic architectures work the same way
let exotic = Arch::intern("my-custom-board");
println!("Exotic: {} (keyword: {})", exotic, exotic.as_keyword());
// Parse a variant
let variant: Variant = "amd64-systemd".parse().unwrap();
println!("Variant: {} (arch: {}, flavor: {})", variant, variant.keyword(), variant.flavor());
```
## Examples
Run the included examples:
```bash
cargo run --example arch
```
## Contributing
See [AGENTS.md](AGENTS.md) for project conventions and contribution guidelines.
## License
MIT