MCPcopy Create free account
hub / github.com/dfinity/ic-repl / bind_value

Function bind_value

src/command.rs:242–260  ·  view source on GitHub ↗
(helper: &mut MyHelper, id: String, v: IDLValue, is_call: bool, display: bool)

Source from the content-addressed store, hash-verified

240}
241
242fn bind_value(helper: &mut MyHelper, id: String, v: IDLValue, is_call: bool, display: bool) {
243 if display {
244 if helper.verbose {
245 println!("{v}");
246 } else if let IDLValue::Text(v) = &v {
247 println!("{v}");
248 }
249 }
250 if is_call {
251 let (v, cost) = crate::profiling::may_extract_profiling(v);
252 if let Some(cost) = cost {
253 let cost_id = format!("__cost_{id}");
254 helper.env.0.insert(cost_id, IDLValue::Int64(cost));
255 }
256 helper.env.0.insert(id, v);
257 } else {
258 helper.env.0.insert(id, v);
259 }
260}

Callers 1

runMethod · 0.85

Calls 1

may_extract_profilingFunction · 0.85

Tested by

no test coverage detected