1use std::mem::size_of;
8
9use gwr_engine::traits::{SimObject, TotalBytes};
10use gwr_engine::types::SimError;
11use gwr_track::id::Unique;
12
13pub type DataGenerator<T> = Box<dyn Iterator<Item = T> + 'static>;
16
17pub type GetResult<T> = Result<T, SimError>;
21
22#[derive(Clone, Debug)]
23pub struct Credit(pub usize);
24
25impl TotalBytes for Credit {
26 fn total_bytes(&self) -> usize {
27 size_of::<usize>()
28 }
29}
30
31impl Unique for Credit {
32 fn id(&self) -> gwr_track::Id {
33 gwr_track::Id(0)
34 }
35}
36
37impl std::fmt::Display for Credit {
38 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
39 write!(f, "credit {}", self.0)
40 }
41}
42
43impl SimObject for Credit {}