/// Handles the provided `command`:
///   - Progresses the matched procedure with the `command`.
///   - Garbage collects the procedure if completed.
///
/// Returns the request from progressing the procedure.
Handles the provided `command`:
Progresses the matched procedure with the `command`.
Garbage collects the procedure if completed.

Returns the request from progressing the procedure.
Handles the provided ` command ` : Progresses the matched procedure with the ` command ` . Garbage collects the procedure if completed . Returns the request from progressing the procedure .
fn handle_command(
        &mut self,
        procedure_id: ProcedureMarker,
        command: Command,
    ) -> ProcedureRequest {
        // Progress the procedure with the message.
        let node = self.inspect.procedures_node();
        let procedure = self.procedures.entry(procedure_id).or_insert_with(|| {
            let mut p = procedure_id.initialize();
            let _ = p.iattach(node, &inspect::unique_name("procedure_"));
            p
        });
        let request = match command {
            Command::Hf(cmd) => procedure.hf_update(cmd, &mut self.state),
            Command::Ag(cmd) => procedure.ag_update(cmd, &mut self.state),
        };
        // Update the SLC State inspect tree as the procedure may have modified state.
        self.inspect.update_slc_state(&self.state);
        // Potentially clean up the procedure if this was the last stage.
        if self.check_and_cleanup_procedure(&procedure_id) && request.requires_response() {
            // Procedures that have been cleaned up cannot require additional responses, as this
            // would violate the `Procedure::is_terminated()` guarantee.
            return ProcedureError::UnexpectedRequest.into();
        }
        request
    }
fn handle_command ( & mut self , procedure_id : ProcedureMarker , command : Command , ) -> ProcedureRequest { // Progress the procedure with the message. let node = self . inspect . procedures_node ( ) ; let procedure = self . procedures . entry ( procedure_id ) . or_insert_with ( | | { let mut p = procedure_id . initialize ( ) ; let _ = p . iattach ( node , & inspect :: unique_name ( " " ) ) ; p } ) ; let request = match command { Command :: Hf ( cmd ) => procedure . hf_update ( cmd , & mut self . state ) , Command :: Ag ( cmd ) => procedure . ag_update ( cmd , & mut self . state ) , } ; // Update the SLC State inspect tree as the procedure may have modified state. self . inspect . update_slc_state ( & self . state ) ; // Potentially clean up the procedure if this was the last stage. if self . check_and_cleanup_procedure ( & procedure_id ) && request . requires_response ( ) { // Procedures that have been cleaned up cannot require additional responses, as this // would violate the `Procedure::is_terminated()` guarantee. return ProcedureError :: UnexpectedRequest . into ( ) ; } request }
Handles the provided `command`:
 Progresses the matched procedure with the `command`.
Handles the provided ` command ` : Progresses the matched procedure with the ` command ` .
&mut self
procedure_id
ProcedureMarker
command
Command