1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use super::{TypeInfo, WorkloadBuilder};
use crate::error;
use crate::type_id::TypeId;
use crate::world::World;
use alloc::boxed::Box;
use alloc::vec::Vec;
pub struct WorkloadSystem {
pub(super) system_type_id: TypeId,
pub(super) system_type_name: &'static str,
pub(super) system_fn: Box<dyn Fn(&World) -> Result<(), error::Run> + Send + Sync + 'static>,
pub(super) borrow_constraints: Vec<TypeInfo>,
pub(super) generator: fn(&mut Vec<TypeInfo>) -> TypeId,
}
impl Extend<WorkloadSystem> for WorkloadBuilder {
fn extend<T: IntoIterator<Item = WorkloadSystem>>(&mut self, iter: T) {
self.systems.extend(iter.into_iter().map(Into::into));
}
}