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

Function may_extract_profiling

src/profiling.rs:164–184  ·  view source on GitHub ↗
(result: IDLValue)

Source from the content-addressed store, hash-verified

162}
163
164pub fn may_extract_profiling(result: IDLValue) -> (IDLValue, Option<i64>) {
165 match result {
166 IDLValue::Record(ref fs) => match fs.as_slice() {
167 [IDLField {
168 id: Label::Id(0),
169 val,
170 }, IDLField {
171 id: Label::Id(1),
172 val: IDLValue::Record(fs),
173 }] => match fs.as_slice() {
174 [IDLField {
175 id: Label::Named(lab),
176 val: IDLValue::Int64(cost),
177 }] if lab == "__cost" => (val.clone(), Some(*cost)),
178 _ => (result, None),
179 },
180 _ => (result, None),
181 },
182 _ => (result, None),
183 }
184}

Callers 1

bind_valueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected