Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cdfd6bb

Browse files
adds skeleton for process Child and Command
1 parent ec23632 commit cdfd6bb

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

‎src/lib.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub mod prelude;
6161
pub mod stream;
6262
pub mod sync;
6363
pub mod task;
64+
pub mod process;
6465

6566
cfg_unstable! {
6667
pub mod pin;

‎src/process/mod.rs‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,59 @@ pub use std::process::{ExitStatus, Output};
1212

1313
// Re-export functions.
1414
pub use std::process::{abort, exit, id};
15+
16+
use std::io;
17+
use std::pin::Pin;
18+
use std::task::Context;
19+
use crate::future::Future;
20+
use crate::task::Poll;
21+
use std::ffi::OsStr;
22+
23+
struct Child {
24+
stdin: Option<ChildStdin>,
25+
stdout: Option<ChildStdout>,
26+
stderr: Option<ChildStderr>,
27+
}
28+
29+
impl Child {
30+
fn id(&self) -> u32 {
31+
unimplemented!("need to do");
32+
}
33+
fn kill(&mut self) -> io::Result<()> {
34+
unimplemented!();
35+
}
36+
async fn output(self) -> io::Result<Output> {
37+
unimplemented!();
38+
}
39+
}
40+
41+
impl Future for Child {
42+
type Output = io::Result<ExitStatus>;
43+
44+
fn poll(self: Pin<&mut Self>, context: &mut Context<'_>) -> Poll<Self::Output> {
45+
unimplemented!();
46+
}
47+
48+
}
49+
50+
struct ChildStdin;
51+
struct ChildStdout;
52+
struct ChildStderr;
53+
54+
struct Command;
55+
56+
impl Command {
57+
fn new<S: AsRef<OsStr>>(program: S) -> Command {
58+
unimplemented!();
59+
}
60+
/// ```
61+
/// let child = Command::new("ls").spawn();
62+
/// let future = child.expect("failed to spawn child");
63+
/// let result = future.await?;
64+
/// assert!(!result.empty());
65+
/// assert!(false);
66+
/// ```
67+
fn spawn(&mut self) -> io::Result<Child> {
68+
unimplemented!();
69+
}
70+
}

‎tests/buf_writer.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ fn test_buffered_writer() {
4747
})
4848
}
4949

50+
#[ignore]
5051
#[test]
5152
fn test_buffered_writer_inner_into_inner_flushes() {
5253
task::block_on(async {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /