docs.rs failed to build unistore-process-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
unistore-process-0.1.1
unistore-process
UniStore 进程管理能力,提供异步子进程创建和管理功能。
概述
unistore-process 提供:
- 异步进程创建
- 标准输入/输出/错误流管理
- 进程生命周期管理
- 优雅终止与强制终止
- 环境变量配置
- 工作目录设置
- 与 UniStore 生命周期集成
安装
[]
= "0.1"
快速开始
use ;
async
命令构建器
let output = new
.args
.current_dir
.env
.output
.await?;
if output.success else
后台进程
use Duration;
// 启动后台进程
let mut child = new
.spawn
.await?;
println!;
// 等待完成或超时
match child.wait_timeout.await?
便捷函数
use ;
// 执行 shell 命令
let output = shell.await?;
// 执行命令并获取标准输出
let version = exec.await?;
// 检查命令是否存在
if let Some = which.await
进程控制
// 优雅终止(发送 SIGTERM / TerminateProcess)
child.terminate.await?;
// 强制终止(发送 SIGKILL / TerminateProcess)
child.kill.await?;
平台支持
| 平台 | 支持状态 |
|---|---|
| Windows | ✅ |
| Linux | ✅ |
| macOS | ✅ |
许可证
MIT OR Apache-2.0
致谢
本 crate 基于以下优秀项目构建:
- tokio - 异步运行时及进程管理
感谢 Tokio 团队提供的出色异步基础设施!