MCPcopy Create free account
hub / github.com/argumentcomputer/ix / decode_to_vec

Method decode_to_vec

crates/ffi/src/ix/env.rs:197–207  ·  view source on GitHub ↗

Decode Ix.RawEnvironment preserving array structure (including duplicates).

(&self)

Source from the content-addressed store, hash-verified

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
210impl<R: LeanRef> LeanIxEnvironment<R> {

Callers 1

Calls 6

as_arrayMethod · 0.80
pushMethod · 0.80
lenMethod · 0.45
iterMethod · 0.45
decodeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected