/// Wait for the component to terminate and return its exit status.
Wait for the component to terminate and return its exit status.
Wait for the component to terminate and return its exit status .
pub fn wait(&mut self) -> impl Future<Output = Result<ExitStatus, Error>> {
        self.controller
            .take_event_stream()
            .try_filter_map(|event| {
                future::ready(match event {
                    ComponentControllerEvent::OnTerminated { return_code, termination_reason } => {
                        Ok(Some(ExitStatus { return_code, termination_reason }))
                    }
                    _ => Ok(None),
                })
            })
            .into_future()
            .map(|(next, _rest)| match next {
                Some(result) => result.map_err(|err| err.into()),
                _ => Ok(ExitStatus {
                    return_code: -1,
                    termination_reason: TerminationReason::Unknown,
                }),
            })
    }
pub fn wait ( & mut self ) -> impl Future < Output = Result < ExitStatus , Error > > { self . controller . take_event_stream ( ) . try_filter_map ( | event | { future :: ready ( match event { ComponentControllerEvent :: OnTerminated { return_code , termination_reason } => { Ok ( Some ( ExitStatus { return_code , termination_reason } ) ) } _ => Ok ( None ) , } ) } ) . into_future ( ) . map ( | ( next , _rest ) | match next { Some ( result ) => result . map_err ( | err | err . into ( ) ) , _ => Ok ( ExitStatus { return_code : - 1 , termination_reason : TerminationReason :: Unknown , } ) , } ) }
Wait for the component to terminate and return its exit status.
Wait for the component to terminate and return its exit status .
&mut self