我想在 Rust 代码中使用异步进程板条箱/包。
https://github.com/smol-rs/async-process.git.
在自述文件中,他们在他们的页面上说可以将其放入我的项目 Cargo.toml 中:
[dependencies]
async_process = "2.0.1" # this cant find it.
async-process = "2.0.1" # this will find it, but name can't be used in code.
在我的 Rust 代码中为:
use async_process::Command; // this fails to find the "crate"
// this is a syntax error as "-" is notvalid in a use path
use async-process::Command
这行不通。 我还尝试了 rust-lang.org 上他们所说的各种变体。
这应该如何运作?
在cargo.toml中,使用
async-process = "2.0.1"
。
在代码中,使用下划线。
use async_process::Command;