async fn execute_protocol<T: NashProtocol + Sync>(
        &self,
        request: T,
    ) -> Result<ResponseOrError<T::Response>> {
        let query = request.graphql(self.state.clone()).await?;
        let ws_response = timeout(
            Duration::from_millis(self.timeout),
            self.request(query).await?.next(),
        )
        .await
        .map_err(|_| ProtocolError("Request timeout"))?
        .ok_or(ProtocolError("Failed to recieve message"))??;
        let json_payload = ws_response.json_payload()?;
        let protocol_response = request.response_from_json(json_payload, self.state.clone()).await?;
        if let Some(response) = protocol_response.response() {
            request
                .process_response(response, self.state.clone())
                .await?;
        };
        Ok(protocol_response)
    }
/// Execute a NashProtocol request. Query will be created, executed over network, response will
/// be passed to the protocol's state update hook, and response will be returned. Used by the even
/// more generic `run(..)`.
Execute a NashProtocol request. Query will be created, executed over network, response will
be passed to the protocol's state update hook, and response will be returned. Used by the even
more generic `run(..)`.
Execute a NashProtocol request . Query will be created executed over network response will be passed to the protocol ' s state update hook and response will be returned . Used by the even more generic ` run ( .. ) ` .
async fn execute_protocol<T: NashProtocol + Sync>(
        &self,
        request: T,
    ) -> Result<ResponseOrError<T::Response>> {
        let query = request.graphql(self.state.clone()).await?;
        let ws_response = timeout(
            Duration::from_millis(self.timeout),
            self.request(query).await?.next(),
        )
        .await
        .map_err(|_| ProtocolError("Request timeout"))?
        .ok_or(ProtocolError("Failed to recieve message"))??;
        let json_payload = ws_response.json_payload()?;
        let protocol_response = request.response_from_json(json_payload, self.state.clone()).await?;
        if let Some(response) = protocol_response.response() {
            request
                .process_response(response, self.state.clone())
                .await?;
        };
        Ok(protocol_response)
    }
async fn execute_protocol < T : NashProtocol + Sync > ( & self , request : T , ) -> Result < ResponseOrError < T :: Response > > { let query = request . graphql ( self . state . clone ( ) ) . await ? ; let ws_response = timeout ( Duration :: from_millis ( self . timeout ) , self . request ( query ) . await ? . next ( ) , ) . await . map_err ( | _ | ProtocolError ( " " ) ) ? . ok_or ( ProtocolError ( " " ) ) ? ? ; let json_payload = ws_response . json_payload ( ) ? ; let protocol_response = request . response_from_json ( json_payload , self . state . clone ( ) ) . await ? ; if let Some ( response ) = protocol_response . response ( ) { request . process_response ( response , self . state . clone ( ) ) . await ? ; } ; Ok ( protocol_response ) }
Execute a NashProtocol request.
Execute a NashProtocol request .
&self
request
T
&self
request
T