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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
use Display;
use ;
/// Default value for layers that can't be read/written as values (e.g. in some cases the root layer)
pub type OpaqueValue = !;
/// Simply a unit type for the root address. `store.root()` returns the location for this one.
///
/// It implements `SubAddress<A>` for every type, simply returning the other operand,
/// so you can easily chain them.
;
/// Ask for this if you only care about the existence of a key
///
/// Implement `AddressFor<Existence, S>` if you know how to
/// ask for existence
;
// #[derive(PartialEq, Eq, Clone, Default, Debug)]
// pub struct ListOfAddresses<BaseAddr: Address + SubAddress<SubAddr>, SubAddr: Clone> {
// pub base: BaseAddr,
// pub list: Vec<SubAddr>,
// }
// impl<
// BaseAddr: Address + SubAddress<SubAddr, Output = WholeAddress>,
// SubAddr: Clone,
// WholeAddress,
// // S: Store + Addressable<BaseAddr> + Addressable<WholeAddress>,
// > ListOfAddresses<BaseAddr, SubAddr>
// {
// pub fn new(base: BaseAddr, list: Vec<SubAddr>) -> Self {
// ListOfAddresses { base, list }
// }
// }
// impl<
// BaseAddr: Address + SubAddress<SubAddr, Output = WholeAddress>,
// SubAddr: Clone,
// WholeAddress,
// > IntoIterator for ListOfAddresses<BaseAddr, SubAddr>
// {
// type Item = WholeAddress;
// type IntoIter = std::vec::IntoIter<WholeAddress>;
// fn into_iter(self) -> Self::IntoIter {
// let base = self.base.clone();
// self.list
// .into_iter()
// .map(|sub: SubAddress| base.clone().sub(sub))
// .collect::<Vec<_>>()
// .into_iter()
// }
// }