Merge pull request #916 from async-rs/async-process

feat: add process module
pull/918/head
Yoshua Wuyts 4 years ago committed by GitHub
commit 9cd0578826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,7 +37,8 @@ default = [
docs = ["attributes", "unstable", "default"] docs = ["attributes", "unstable", "default"]
unstable = [ unstable = [
"std", "std",
"async-io" "async-io",
"async-process",
] ]
attributes = ["async-attributes"] attributes = ["async-attributes"]
std = [ std = [
@ -86,6 +87,7 @@ async-global-executor = { version = "1.4.0", optional = true, features = ["async
async-io = { version = "1.0.1", optional = true } async-io = { version = "1.0.1", optional = true }
blocking = { version = "1.0.0", optional = true } blocking = { version = "1.0.0", optional = true }
futures-lite = { version = "1.0.0", optional = true } futures-lite = { version = "1.0.0", optional = true }
async-process = { version = "1.0.1", optional = true }
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
gloo-timers = { version = "0.2.1", features = ["futures"], optional = true } gloo-timers = { version = "0.2.1", features = ["futures"], optional = true }

@ -313,7 +313,7 @@ cfg_default! {
cfg_unstable! { cfg_unstable! {
pub mod pin; pub mod pin;
#[cfg(not(target_os = "unknown"))] #[cfg(all(not(target_os = "unknown"), feature = "std"))]
pub mod process; pub mod process;
mod unit; mod unit;

@ -8,3 +8,8 @@ cfg_default! {
pub mod fs; pub mod fs;
pub mod net; pub mod net;
} }
#[cfg(all(feature = "unstable", feature = "std"))]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[doc(inline)]
pub use async_process::unix as process;

@ -7,4 +7,7 @@ cfg_std! {
cfg_unstable! { cfg_unstable! {
#[cfg(feature = "default")] #[cfg(feature = "default")]
pub mod fs; pub mod fs;
#[cfg(feature = "std")]
#[cfg(windows)]
pub use async_process::windows as process;
} }

@ -0,0 +1,40 @@
//! A module for working with processes.
//!
//! This module is mostly concerned with spawning and interacting with child processes, but it also
//! provides abort and exit for terminating the current process.
//!
//! This is an async version of [`std::process`].
//!
//! [`std::process`]: https://doc.rust-lang.org/std/process/index.html
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[doc(inline)]
pub use async_process::ExitStatus;
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[doc(inline)]
pub use async_process::Output;
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[doc(inline)]
pub use async_process::Stdio;
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[doc(inline)]
pub use async_process::Child;
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[doc(inline)]
pub use async_process::ChildStderr;
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[doc(inline)]
pub use async_process::ChildStdin;
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[doc(inline)]
pub use async_process::ChildStdout;
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[doc(inline)]
pub use async_process::Command;

@ -1,14 +0,0 @@
//! A module for working with processes.
//!
//! This module is mostly concerned with spawning and interacting with child processes, but it also
//! provides abort and exit for terminating the current process.
//!
//! This is an async version of [`std::process`].
//!
//! [`std::process`]: https://doc.rust-lang.org/std/process/index.html
// Re-export structs.
pub use std::process::{ExitStatus, Output};
// Re-export functions.
pub use std::process::{abort, exit, id};
Loading…
Cancel
Save