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

Function load_function_handles

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

Builds the `FunctionHandle` table.

(
    binary: &VersionedBinary,
    table: &Table,
    function_handles: &mut Vec<FunctionHandle>,
)

Source from the content-addressed store, hash-verified

675
676/// Builds the `FunctionHandle` table.
677fn load_function_handles(
678 binary: &VersionedBinary,
679 table: &Table,
680 function_handles: &mut Vec<FunctionHandle>,
681) -> BinaryLoaderResult<()> {
682 let start = table.offset as usize;
683 let end = start + table.count as usize;
684 let mut cursor = binary.new_cursor(start, end);
685 while cursor.position() < table.count as u64 {
686 let module = load_module_handle_index(&mut cursor)?;
687 let name = load_identifier_index(&mut cursor)?;
688 let parameters = load_signature_index(&mut cursor)?;
689 let return_ = load_signature_index(&mut cursor)?;
690 let type_parameters =
691 load_ability_sets(&mut cursor, AbilitySetPosition::FunctionTypeParameters)?;
692
693 function_handles.push(FunctionHandle {
694 module,
695 name,
696 parameters,
697 return_,
698 type_parameters,
699 });
700 }
701 Ok(())
702}
703
704/// Builds the `StructInstantiation` table.
705fn load_struct_instantiations(

Callers 1

build_common_tablesFunction · 0.85

Calls 7

load_module_handle_indexFunction · 0.85
load_identifier_indexFunction · 0.85
load_signature_indexFunction · 0.85
load_ability_setsFunction · 0.85
new_cursorMethod · 0.80
positionMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected