You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: mod.rs
    path of file: ./repos/deep_causality/deep_causality/src/types/csm_types
    
    the code of the file until where you have to start completion: // SPDX-License-Identifier: MIT
// Copyright (c) "2023" . The DeepCausality Authors. All Rights Reserved.

use std::cell::RefCell;
use std::collections::HashMap;
use std::hash::Hash;
use std::ops::{Add, Mul, Sub};

use crate::errors::{ActionError, UpdateError};
use crate::prelude::{
    CausalAction, CausalState, Datable,
    
    pub fn eval_all_states(&self) -> Result<(), ActionError> {
        for (_, (state, action)) in self.state_actions.borrow().iter() {
            let eval = state.eval();

            // check if the causal state evaluation returned an error
            if eval.is_err() {
                return Err(ActionError(format!(
                    "CSM[eval]: Error evaluating causal state: {}",
                    state
                )));
            }

            // Unpack the bool result
            let trigger =
                eval.expect("CSM[eval]: Failed to unwrap evaluation result from causal state}");

            // If the state evaluated to true, fire the associated action.
            if trigger && action.fire().is_err() {
                return Err(ActionError(format!(
                    "CSM[eval]: Failed to fire action associated with causal state {}",
                    state
                )));
            }
        }