1use thiserror::Error;
4
5#[derive(Debug, Clone, PartialEq, Eq, Error)]
7pub enum SimulationError {
8 #[error("Simulation has been shut down")]
10 SimulationShutdown,
11 #[error("Invalid simulation state: {0}")]
13 InvalidState(String),
14 #[error("I/O error: {0}")]
16 IoError(String),
17}
18
19pub type SimulationResult<T> = Result<T, SimulationError>;
21
22impl From<std::io::Error> for SimulationError {
23 fn from(err: std::io::Error) -> Self {
24 SimulationError::IoError(err.to_string())
25 }
26}