Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

示例

English | 中文 | 日本語 | 한국어 | Français | Deutsch | Español | Português | Svenska | Suomi | Nederlands

仓库包含可运行示例。这些示例覆盖 config tree(配置树) 加载、 CLI(命令行接口) 覆盖参数、内置配置命令、模板生成和低层 tree API(树形接口)。

可以阅读仓库 examples(示例目录) 索引:

在仓库根目录运行示例:

cargo run --example basic_loading
cargo run --example cli_overrides -- --server-port 9000
cargo run --example config_commands -- config-template
cargo run --example config_commands -- config-schema
cargo run --example config_commands -- config-validate
cargo run --example generate_templates
cargo run --example tree_api

config_commands 的 template(模板) 和 schema(结构定义) 命令使用 CLI 默认路径, 因此 AppConfig 会把生成文件写到 config/app_config/ 下。