diff --git a/src/lib.rs b/src/lib.rs index 7f888a14a..320c28f98 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,6 +61,7 @@ pub mod prelude; pub mod stream; pub mod sync; pub mod task; +pub mod process; cfg_unstable! { pub mod pin; diff --git a/src/process/mod.rs b/src/process/mod.rs index 630c5b9b9..f2f6b1bc1 100644 --- a/src/process/mod.rs +++ b/src/process/mod.rs @@ -12,3 +12,64 @@ pub use std::process::{ExitStatus, Output}; // Re-export functions. pub use std::process::{abort, exit, id}; + +use std::io; +use std::pin::Pin; +use std::task::Context; +use crate::future::Future; +use crate::task::Poll; +use std::ffi::OsStr; + +pub struct Child { + stdin: Option, + stdout: Option, + stderr: Option, +} + +impl Child { + fn id(&self) -> u32 { + unimplemented!("need to do"); + } + fn kill(&mut self) -> io::Result<()> { + unimplemented!(); + } + async fn output(self) -> io::Result { + unimplemented!(); + } +} + +impl Future for Child { + type Output = io::Result; + + fn poll(self: Pin<&mut Self>, context: &mut Context<'_>) -> Poll { + unimplemented!(); + } + +} + +struct ChildStdin; +struct ChildStdout; +struct ChildStderr; + +pub struct Command; + +impl Command { + pub fn new>(program: S) -> Command { + unimplemented!(); + } + /// ``` + /// # fn main() -> std::io::Result<()> { async_std::task::block_on(async { + /// # + /// use async_std::process::Command; + /// let child = Command::new("ls").spawn(); + /// let future = child.expect("failed to spawn child"); + /// let result = future.await?; + /// assert!(result.success()); + /// assert!(false); + /// # + /// # Ok(()) }) } + /// ``` + pub fn spawn(&mut self) -> io::Result { + unimplemented!(); + } +}