pub struct TokioChildProcess { /* private fields */ }Implementations§
Source§impl TokioChildProcess
impl TokioChildProcess
Sourcepub fn new(command: impl Into<CommandWrap>) -> Result<TokioChildProcess, Error>
pub fn new(command: impl Into<CommandWrap>) -> Result<TokioChildProcess, Error>
Convenience: spawn with default piped stdio
Sourcepub fn builder(command: impl Into<CommandWrap>) -> TokioChildProcessBuilder
pub fn builder(command: impl Into<CommandWrap>) -> TokioChildProcessBuilder
Builder entry-point allowing fine-grained stdio control.
Sourcepub async fn graceful_shutdown(&mut self) -> Result<(), Error>
pub async fn graceful_shutdown(&mut self) -> Result<(), Error>
Gracefully shutdown the child process
This will first close the transport to the child process (the server), and wait for the child process to exit normally with a timeout. If the child process doesn’t exit within the timeout, it will be killed.
Sourcepub fn into_inner(self) -> Option<Box<dyn ChildWrapper>>
pub fn into_inner(self) -> Option<Box<dyn ChildWrapper>>
Take ownership of the inner child process
Sourcepub fn split(self) -> (TokioChildProcessOut, ChildStdin)
👎Deprecated since 0.5.0: use the Transport trait implementation instead
pub fn split(self) -> (TokioChildProcessOut, ChildStdin)
use the Transport trait implementation instead
Split this helper into a reader (stdout) and writer (stdin).
Trait Implementations§
Source§impl Transport<RoleClient> for TokioChildProcess
impl Transport<RoleClient> for TokioChildProcess
type Error = Error
Source§fn send(
&mut self,
item: JsonRpcMessage<<RoleClient as ServiceRole>::Req, <RoleClient as ServiceRole>::Resp, <RoleClient as ServiceRole>::Not>,
) -> impl Future<Output = Result<(), <TokioChildProcess as Transport<RoleClient>>::Error>> + Send + 'static
fn send( &mut self, item: JsonRpcMessage<<RoleClient as ServiceRole>::Req, <RoleClient as ServiceRole>::Resp, <RoleClient as ServiceRole>::Not>, ) -> impl Future<Output = Result<(), <TokioChildProcess as Transport<RoleClient>>::Error>> + Send + 'static
Send a message to the transport Read more
Source§fn receive(
&mut self,
) -> impl Future<Output = Option<JsonRpcMessage<<RoleClient as ServiceRole>::PeerReq, <RoleClient as ServiceRole>::PeerResp, <RoleClient as ServiceRole>::PeerNot>>> + Send
fn receive( &mut self, ) -> impl Future<Output = Option<JsonRpcMessage<<RoleClient as ServiceRole>::PeerReq, <RoleClient as ServiceRole>::PeerResp, <RoleClient as ServiceRole>::PeerNot>>> + Send
Receive a message from the transport, this operation is sequential.
Source§fn close(
&mut self,
) -> impl Future<Output = Result<(), <TokioChildProcess as Transport<RoleClient>>::Error>> + Send
fn close( &mut self, ) -> impl Future<Output = Result<(), <TokioChildProcess as Transport<RoleClient>>::Error>> + Send
Close the transport
fn name() -> Cow<'static, str>
Auto Trait Implementations§
impl Freeze for TokioChildProcess
impl !RefUnwindSafe for TokioChildProcess
impl Send for TokioChildProcess
impl Sync for TokioChildProcess
impl Unpin for TokioChildProcess
impl UnsafeUnpin for TokioChildProcess
impl !UnwindSafe for TokioChildProcess
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more