Skip to main content

component_map/
lib.rs

1use derive_more::Constructor;
2use std::collections::HashMap;
3
4mod async_fallible;
5mod async_infallible;
6mod sync_fallible;
7mod sync_infallible;
8
9#[derive(Debug, Constructor)]
10pub struct Keyed<Key, Value> {
11    pub key: Key,
12    pub value: Value,
13}
14
15#[derive(Debug, Constructor)]
16pub struct WithArgs<Args, Comp> {
17    pub component: Comp,
18    pub args: Args,
19}
20
21#[derive(Debug, Constructor)]
22pub struct ComponentMap<Key, Args, Comp, FnInit> {
23    pub map: HashMap<Key, WithArgs<Args, Comp>>,
24    pub init: FnInit,
25}