11use std:: process:: Stdio ;
22
33use futures:: future:: Future ;
4- use process_wrap:: tokio:: { TokioChildWrapper , TokioCommandWrap } ;
4+ use process_wrap:: tokio:: { ChildWrapper , CommandWrap } ;
55use tokio:: {
66 io:: AsyncRead ,
77 process:: { ChildStderr , ChildStdin , ChildStdout } ,
@@ -13,7 +13,7 @@ use crate::RoleClient;
1313const MAX_WAIT_ON_DROP_SECS : u64 = 3 ;
1414/// The parts of a child process.
1515type ChildProcessParts = (
16- Box < dyn TokioChildWrapper > ,
16+ Box < dyn ChildWrapper > ,
1717 ChildStdout ,
1818 ChildStdin ,
1919 Option < ChildStderr > ,
@@ -23,7 +23,7 @@ type ChildProcessParts = (
2323/// Returns `(child, stdout, stdin, stderr)` where `stderr` is `Some` only
2424/// if the process was spawned with `Stdio::piped()`.
2525#[ inline]
26- fn child_process ( mut child : Box < dyn TokioChildWrapper > ) -> std:: io:: Result < ChildProcessParts > {
26+ fn child_process ( mut child : Box < dyn ChildWrapper > ) -> std:: io:: Result < ChildProcessParts > {
2727 let child_stdin = match child. inner_mut ( ) . stdin ( ) . take ( ) {
2828 Some ( stdin) => stdin,
2929 None => return Err ( std:: io:: Error :: other ( "stdin was already taken" ) ) ,
@@ -42,7 +42,7 @@ pub struct TokioChildProcess {
4242}
4343
4444pub struct ChildWithCleanup {
45- inner : Option < Box < dyn TokioChildWrapper > > ,
45+ inner : Option < Box < dyn ChildWrapper > > ,
4646}
4747
4848impl Drop for ChildWithCleanup {
@@ -87,13 +87,13 @@ impl AsyncRead for TokioChildProcessOut {
8787
8888impl TokioChildProcess {
8989 /// Convenience: spawn with default `piped` stdio
90- pub fn new ( command : impl Into < TokioCommandWrap > ) -> std:: io:: Result < Self > {
90+ pub fn new ( command : impl Into < CommandWrap > ) -> std:: io:: Result < Self > {
9191 let ( proc, _ignored) = TokioChildProcessBuilder :: new ( command) . spawn ( ) ?;
9292 Ok ( proc)
9393 }
9494
9595 /// Builder entry-point allowing fine-grained stdio control.
96- pub fn builder ( command : impl Into < TokioCommandWrap > ) -> TokioChildProcessBuilder {
96+ pub fn builder ( command : impl Into < CommandWrap > ) -> TokioChildProcessBuilder {
9797 TokioChildProcessBuilder :: new ( command)
9898 }
9999
@@ -111,7 +111,7 @@ impl TokioChildProcess {
111111 if let Some ( mut child) = self . child . inner . take ( ) {
112112 self . transport . close ( ) . await ?;
113113
114- let wait_fut = Box :: into_pin ( child. wait ( ) ) ;
114+ let wait_fut = child. wait ( ) ;
115115 tokio:: select! {
116116 _ = tokio:: time:: sleep( std:: time:: Duration :: from_secs( MAX_WAIT_ON_DROP_SECS ) ) => {
117117 if let Err ( e) = Box :: into_pin( child. kill( ) ) . await {
@@ -136,7 +136,7 @@ impl TokioChildProcess {
136136 }
137137
138138 /// Take ownership of the inner child process
139- pub fn into_inner ( mut self ) -> Option < Box < dyn TokioChildWrapper > > {
139+ pub fn into_inner ( mut self ) -> Option < Box < dyn ChildWrapper > > {
140140 self . child . inner . take ( )
141141 }
142142
@@ -152,14 +152,14 @@ impl TokioChildProcess {
152152
153153/// Builder for `TokioChildProcess` allowing custom `Stdio` configuration.
154154pub struct TokioChildProcessBuilder {
155- cmd : TokioCommandWrap ,
155+ cmd : CommandWrap ,
156156 stdin : Stdio ,
157157 stdout : Stdio ,
158158 stderr : Stdio ,
159159}
160160
161161impl TokioChildProcessBuilder {
162- fn new ( cmd : impl Into < TokioCommandWrap > ) -> Self {
162+ fn new ( cmd : impl Into < CommandWrap > ) -> Self {
163163 Self {
164164 cmd : cmd. into ( ) ,
165165 stdin : Stdio :: piped ( ) ,
0 commit comments