From bcbf0506ff255129d5a66d709bdb6aafbfbe2331 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 25 Apr 2026 19:12:00 +0800 Subject: Add async example demonstrating tokio integration --- docs/README.md | 1 + docs/pages/2-basic/2-setup.md | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/README.md b/docs/README.md index 6dd9667..03e17dc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -134,6 +134,7 @@ The Mingling project consists of two main parts: ## Example Projects - **[`examples/example-basic/`](examples/example-basic/src/main.rs)** - A simple "Hello, World!" example demonstrating the most basic usage of a Dispatcher and Renderer. +- **[`examples/example-async/`](examples/example-async/src/main.rs)** - Based on `example-basic`, demonstrates how to integrate an async runtime - **[`examples/example-picker/`](examples/example-picker/src/main.rs)** - Demonstrates how to use a Chain to process and transform command arguments. - **[`examples/example-general-renderer/`](examples/example-general-renderer/src/main.rs)** - Shows how to use a general renderer for different data types (e.g., JSON, YAML, TOML, RON). - **[`examples/example-completion/`](examples/example-completion/src/main.rs)** - An example implementing auto-completion for the shell. diff --git a/docs/pages/2-basic/2-setup.md b/docs/pages/2-basic/2-setup.md index 97fbc5a..102e213 100644 --- a/docs/pages/2-basic/2-setup.md +++ b/docs/pages/2-basic/2-setup.md @@ -15,12 +15,12 @@ It is defined as follows: ```rust struct MySetup; -impl ProgramSetup +impl ProgramSetup for MySetup { fn setup( &mut self, - program: &mut Program + program: &mut Program ) { // Your setup logic } @@ -89,7 +89,7 @@ If you find the above declaration method too **verbose**, you can use the `progr ```rust #[program_setup] fn my_setup( - program: &mut Program + program: &mut Program ) { // Your setup logic } @@ -127,7 +127,7 @@ dispatcher!("member.rm", #[program_setup] fn my_setup( - program: &mut Program + program: &mut Program ) { program.with_dispatcher(AddMemberCommand); program.with_dispatcher(RemoveMemberCommand); -- cgit