pub struct Simulation {
pub id: Uuid,
pub name: String,
pub token: Token,
pub description: Option<String>,
pub status: SimulationStatus,
pub options: SimulationOptions,
pub interval_reports: HashMap<u64, SimulationReport, BuildHasherDefault<XxHash64>>,
pub report: SimulationReport,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}
Fields§
§id: Uuid
ID of the simulation.
name: String
Name of the simulation.
token: Token
Token used in the simulation.
description: Option<String>
Description of the simulation.
status: SimulationStatus
Status of the simulation.
options: SimulationOptions
Input parameters for the simulation.
interval_reports: HashMap<u64, SimulationReport, BuildHasherDefault<XxHash64>>
Report of the results for each interval of the simulation.
report: SimulationReport
Report of the total results of the simulation.
created_at: DateTime<Utc>
Date and time the simulation was created.
updated_at: DateTime<Utc>
Date and time the simulation was last updated.
Implementations§
Source§impl Simulation
impl Simulation
Sourcepub fn update_status(&mut self, status: SimulationStatus)
pub fn update_status(&mut self, status: SimulationStatus)
Sourcepub fn process_interval(
&self,
users: &mut [User],
interval: u64,
) -> SimulationReport
pub fn process_interval( &self, users: &mut [User], interval: u64, ) -> SimulationReport
Sourcepub fn generate_report(&mut self, users: &[User])
pub fn generate_report(&mut self, users: &[User])
Sourcepub fn get_interval(&self) -> u64
pub fn get_interval(&self) -> u64
Trait Implementations§
Source§impl Debug for Simulation
impl Debug for Simulation
Source§impl<'de> Deserialize<'de> for Simulation
impl<'de> Deserialize<'de> for Simulation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Simulation
impl RefUnwindSafe for Simulation
impl Send for Simulation
impl Sync for Simulation
impl Unpin for Simulation
impl UnwindSafe for Simulation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more