Expand description
ax-config-gen
A TOML-based configuration generation tool for ArceOS
English | 中文
§Introduction
ax-config-gen provides A TOML-based configuration generation tool for ArceOS. It is maintained as part of the TGOSKits component set and is intended for Rust projects that integrate with ArceOS, AxVisor, or related low-level systems software.
ax-config-gen was derived from https://github.com/arceos-org/axconfig-gen
§Quick Start
§Installation
Add this crate to your Cargo.toml:
[dependencies]
ax-config-gen = "0.4.1"§Run Check and Test
# Enter the crate directory
cd components/axconfig-gen/axconfig-gen
# Format code
cargo fmt --all
# Run clippy
cargo clippy --all-targets --all-features
# Run tests
cargo test --all-features
# Build documentation
cargo doc --no-deps§Integration
§Example
use ax_config_gen as _;
fn main() {
// Integrate `ax-config-gen` into your project here.
}§Documentation
Generate and view API documentation:
cargo doc --no-deps --openOnline documentation: docs.rs/ax-config-gen
§Contributing
- Fork the repository and create a branch
- Run local format and checks
- Run local tests relevant to this crate
- Submit a PR and ensure CI passes
§License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Structs§
- Config
- A structure storing all config items.
- Config
Item - A structure representing a config item.
- Config
Value - A structure representing a config value.
- Generate
Options - Options for loading, merging, updating, and writing config files.
- Generate
Report - Result of a config generation run.
- Load
Report - Result of loading and updating config state before output generation.
Enums§
- Config
Err - The error type on config parsing.
- Config
Type - The supported types in the config file.
- Output
Format - The format of the generated file.
Functions§
- apply_
config_ writes - Apply write overrides to a loaded config.
- generate_
config - Generate config output from specs, optional old config, and write overrides.
- load_
config - Load one config file.
- load_
config_ specs - Load and merge config specification files.
- load_
config_ state - Load config state from specs, optional old config, and write overrides.
- parse_
config_ read_ arg - Parse a config read argument in
keyortable.keyform. - parse_
config_ write_ arg - Parse a config write argument in
key=valueortable.key=valueform. - read_
config_ string - Read one string config item value from merged specs.
- read_
config_ value - Read one config item value from merged specs.
- read_
loaded_ config_ string - Read one string config item value from an already loaded config.
- read_
loaded_ config_ value - Read one config item value from an already loaded config.
Type Aliases§
- Config
Result - A specialized
Resulttype withConfigErras the error type.