Skip to main content

Crate ax_config_gen

Crate ax_config_gen 

Source
Expand description

ax-config-gen

A TOML-based configuration generation tool for ArceOS

Crates.io Docs.rs Rust License

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 --open

Online documentation: docs.rs/ax-config-gen

§Contributing

  1. Fork the repository and create a branch
  2. Run local format and checks
  3. Run local tests relevant to this crate
  4. 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.
ConfigItem
A structure representing a config item.
ConfigValue
A structure representing a config value.
GenerateOptions
Options for loading, merging, updating, and writing config files.
GenerateReport
Result of a config generation run.
LoadReport
Result of loading and updating config state before output generation.

Enums§

ConfigErr
The error type on config parsing.
ConfigType
The supported types in the config file.
OutputFormat
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 key or table.key form.
parse_config_write_arg
Parse a config write argument in key=value or table.key=value form.
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§

ConfigResult
A specialized Result type with ConfigErr as the error type.