async fn run_helper<T: NashProtocolPipeline>(
        &self,
        request: T,
    ) -> Result<ResponseOrError<<T::ActionType as NashProtocol>::Response>> {
        let mut protocol_state = request.init_state(self.state.clone()).await;
        // While pipeline containst more actions for client to take, execute them
        loop {
            if let Some(protocol_request) = request
                .next_step(&protocol_state, self.state.clone())
                .await?
            {
                let protocol_response = self.execute_protocol(protocol_request).await?;
                // If error, end pipeline early and return GraphQL/network error data
                if protocol_response.is_error() {
                    return Ok(ResponseOrError::Error(
                        protocol_response
                            .consume_error()
                            .expect("Destructure error after check. Impossible to fail."),
                    ));
                }
                // Otherwise update the pipeline and continue
                request
                    .process_step(
                        protocol_response
                            .consume_response()
                            .expect("Destructure response after check. Impossible to fail."),
                        &mut protocol_state,
                    )
                    .await;
            } else {
                // If no more actions left, then done
                break;
            }
        }
        // Get pipeline output
        let output = request.output(protocol_state)?;
        Ok(output)
    }
/// Does the main work of running a pipeline
Does the main work of running a pipeline
Does the main work of running a pipeline
async fn run_helper<T: NashProtocolPipeline>(
        &self,
        request: T,
    ) -> Result<ResponseOrError<<T::ActionType as NashProtocol>::Response>> {
        let mut protocol_state = request.init_state(self.state.clone()).await;
        // While pipeline containst more actions for client to take, execute them
        loop {
            if let Some(protocol_request) = request
                .next_step(&protocol_state, self.state.clone())
                .await?
            {
                let protocol_response = self.execute_protocol(protocol_request).await?;
                // If error, end pipeline early and return GraphQL/network error data
                if protocol_response.is_error() {
                    return Ok(ResponseOrError::Error(
                        protocol_response
                            .consume_error()
                            .expect("Destructure error after check. Impossible to fail."),
                    ));
                }
                // Otherwise update the pipeline and continue
                request
                    .process_step(
                        protocol_response
                            .consume_response()
                            .expect("Destructure response after check. Impossible to fail."),
                        &mut protocol_state,
                    )
                    .await;
            } else {
                // If no more actions left, then done
                break;
            }
        }
        // Get pipeline output
        let output = request.output(protocol_state)?;
        Ok(output)
    }
async fn run_helper < T : NashProtocolPipeline > ( & self , request : T , ) -> Result < ResponseOrError < < T :: ActionType as NashProtocol > :: Response > > { let mut protocol_state = request . init_state ( self . state . clone ( ) ) . await ; // While pipeline containst more actions for client to take, execute them loop { if let Some ( protocol_request ) = request . next_step ( & protocol_state , self . state . clone ( ) ) . await ? { let protocol_response = self . execute_protocol ( protocol_request ) . await ? ; // If error, end pipeline early and return GraphQL/network error data if protocol_response . is_error ( ) { return Ok ( ResponseOrError :: Error ( protocol_response . consume_error ( ) . expect ( " " ) , ) ) ; } // Otherwise update the pipeline and continue request . process_step ( protocol_response . consume_response ( ) . expect ( " " ) , & mut protocol_state , ) . await ; } else { // If no more actions left, then done break ; } } // Get pipeline output let output = request . output ( protocol_state ) ? ; Ok ( output ) }
Does the main work of running a pipeline
Does the main work of running a pipeline
&self
request
T
&self
request
T