fn handle_response(
        &mut self,
        response: Response,
        measurement_scope: &MeasurementScope,
    ) -> Option<Result<WasmResult, UserError>> {
        if self.outstanding_response.is_some() {
            fatal!(
                self.log,
                "[EXC-BUG] Prioritising responses invariant failed. There will never be more than one outstanding response."
            );
        }

        let canister_id = response.originator;
        // As we are executing a response, we must have executed a request on
        // the canister before and must have stored its state so the following
        // should not fail.
        let canister = self.canisters.remove(&canister_id).unwrap_or_else(|| {
            fatal!(
                self.log,
                "Expected to find canister {} in the cache",
                canister_id
            )
        });

        let (canister, call_context_id, call_origin, execution_result) =
            self.execute_callback(canister, response, measurement_scope);

        match call_origin {
            CallOrigin::Query(_) => {
                self.handle_response_with_query_origin(canister, call_context_id, execution_result)
            }

            CallOrigin::CanisterUpdate(_, _)
            | CallOrigin::Ingress(_, _)
            | CallOrigin::Heartbeat => fatal!(
                self.log,
                "Canister {}: query path should not have created a callback with an update origin",
                canister_id
            ),

            CallOrigin::CanisterQuery(originator, callback_id) => self
                .handle_response_with_canister_origin(
                    canister,
                    originator,
                    callback_id,
                    call_context_id,
                    execution_result,
                ),
        }
    }
// Executes a query response sent from a canister to another canister.  If
// executing the response produces another response that terminates the
// query context, it is returned; otherwise, None is returned.  Any other
// intermediate requests or response are enqueued by the function.
Executes a query response sent from a canister to another canister.  If
executing the response produces another response that terminates the
query context, it is returned; otherwise, None is returned.  Any other
intermediate requests or response are enqueued by the function.
Executes a query response sent from a canister to another canister . If executing the response produces another response that terminates the query context it is returned ; otherwise None is returned . Any other intermediate requests or response are enqueued by the function .
fn handle_response(
        &mut self,
        response: Response,
        measurement_scope: &MeasurementScope,
    ) -> Option<Result<WasmResult, UserError>> {
        if self.outstanding_response.is_some() {
            fatal!(
                self.log,
                "[EXC-BUG] Prioritising responses invariant failed. There will never be more than one outstanding response."
            );
        }
        let canister_id = response.originator;
        // As we are executing a response, we must have executed a request on
        // the canister before and must have stored its state so the following
        // should not fail.
        let canister = self.canisters.remove(&canister_id).unwrap_or_else(|| {
            fatal!(
                self.log,
                "Expected to find canister {} in the cache",
                canister_id
            )
        });
        let (canister, call_context_id, call_origin, execution_result) =
            self.execute_callback(canister, response, measurement_scope);
        match call_origin {
            CallOrigin::Query(_) => {
                self.handle_response_with_query_origin(canister, call_context_id, execution_result)
            }
            CallOrigin::CanisterUpdate(_, _)
            | CallOrigin::Ingress(_, _)
            | CallOrigin::Heartbeat => fatal!(
                self.log,
                "Canister {}: query path should not have created a callback with an update origin",
                canister_id
            ),
            CallOrigin::CanisterQuery(originator, callback_id) => self
                .handle_response_with_canister_origin(
                    canister,
                    originator,
                    callback_id,
                    call_context_id,
                    execution_result,
                ),
        }
    }
fn handle_response ( & mut self , response : Response , measurement_scope : & MeasurementScope , ) -> Option < Result < WasmResult , UserError > > { if self . outstanding_response . is_some ( ) { fatal ! ( self log " " ) ; } let canister_id = response . originator ; // As we are executing a response, we must have executed a request on // the canister before and must have stored its state so the following // should not fail. let canister = self . canisters . remove ( & canister_id ) . unwrap_or_else ( | | { fatal ! ( self log " " canister_id ) } ) ; let ( canister , call_context_id , call_origin , execution_result ) = self . execute_callback ( canister , response , measurement_scope ) ; match call_origin { CallOrigin :: Query ( _ ) => { self . handle_response_with_query_origin ( canister , call_context_id , execution_result ) } CallOrigin :: CanisterUpdate ( _ , _ ) | CallOrigin :: Ingress ( _ , _ ) | CallOrigin :: Heartbeat => fatal ! ( self log " " canister_id ) , CallOrigin :: CanisterQuery ( originator , callback_id ) => self . handle_response_with_canister_origin ( canister , originator , callback_id , call_context_id , execution_result , ) , } }
Executes a query response sent from a canister to another canister.
Executes a query response sent from a canister to another canister .
&mut self
response
Response
measurement_scope
&MeasurementScope
&mut self
response
Response
measurement_scope
&MeasurementScope