MCPcopy Create free account
hub / github.com/diem/move / load_code_unit

Function load_code_unit

language/move-binary-format/src/deserializer.rs:1338–1348  ·  view source on GitHub ↗

Deserializes a `CodeUnit`.

(cursor: &mut VersionedCursor)

Source from the content-addressed store, hash-verified

1336
1337/// Deserializes a `CodeUnit`.
1338fn load_code_unit(cursor: &mut VersionedCursor) -> BinaryLoaderResult<CodeUnit> {
1339 let locals = load_signature_index(cursor)?;
1340
1341 let mut code_unit = CodeUnit {
1342 locals,
1343 code: vec![],
1344 };
1345
1346 load_code(cursor, &mut code_unit.code)?;
1347 Ok(code_unit)
1348}
1349
1350/// Deserializes a code stream (`Bytecode`s).
1351fn load_code(cursor: &mut VersionedCursor, code: &mut Vec<Bytecode>) -> BinaryLoaderResult<()> {

Callers 2

load_function_defFunction · 0.85

Calls 2

load_signature_indexFunction · 0.85
load_codeFunction · 0.85

Tested by

no test coverage detected