Decode Ix.RawEnvironment preserving array structure (including duplicates).
(&self)
| 195 | |
| 196 | /// Decode Ix.RawEnvironment preserving array structure (including duplicates). |
| 197 | pub fn decode_to_vec(&self) -> Vec<(Name, ConstantInfo)> { |
| 198 | let arr = self.as_array(); |
| 199 | let mut consts = Vec::with_capacity(arr.len()); |
| 200 | for pair_obj in arr.iter() { |
| 201 | let pair = pair_obj.as_ctor(); |
| 202 | let name = LeanIxName(pair.get(0)).decode(); |
| 203 | let info = LeanIxConstantInfo(pair.get(1)).decode(); |
| 204 | consts.push((name, info)); |
| 205 | } |
| 206 | consts |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | impl<R: LeanRef> LeanIxEnvironment<R> { |