fn load_function_handles(
    binary: &[u8],
    table: &Table,
    function_handles: &mut Vec<FunctionHandle>,
) -> BinaryLoaderResult<()> {
    let start = table.offset as usize;
    let end = start + table.count as usize;
    let mut cursor = Cursor::new(&binary[start..end]);
    loop {
        if cursor.position() == u64::from(table.count) {
            break;
        }
        let module_handle = read_uleb_u16_internal(&mut cursor)?;
        let name = read_uleb_u16_internal(&mut cursor)?;
        let parameters = read_uleb_u16_internal(&mut cursor)?;
        let return_ = read_uleb_u16_internal(&mut cursor)?;
        let type_parameters = load_kinds(&mut cursor)?;

        function_handles.push(FunctionHandle {
            module: ModuleHandleIndex(module_handle),
            name: IdentifierIndex(name),
            parameters: SignatureIndex(parameters),
            return_: SignatureIndex(return_),
            type_parameters,
        });
    }
    Ok(())
}
/// Builds the `FunctionHandle` table.
Builds the `FunctionHandle` table.
Builds the ` FunctionHandle ` table .
fn load_function_handles(
    binary: &[u8],
    table: &Table,
    function_handles: &mut Vec<FunctionHandle>,
) -> BinaryLoaderResult<()> {
    let start = table.offset as usize;
    let end = start + table.count as usize;
    let mut cursor = Cursor::new(&binary[start..end]);
    loop {
        if cursor.position() == u64::from(table.count) {
            break;
        }
        let module_handle = read_uleb_u16_internal(&mut cursor)?;
        let name = read_uleb_u16_internal(&mut cursor)?;
        let parameters = read_uleb_u16_internal(&mut cursor)?;
        let return_ = read_uleb_u16_internal(&mut cursor)?;
        let type_parameters = load_kinds(&mut cursor)?;
        function_handles.push(FunctionHandle {
            module: ModuleHandleIndex(module_handle),
            name: IdentifierIndex(name),
            parameters: SignatureIndex(parameters),
            return_: SignatureIndex(return_),
            type_parameters,
        });
    }
    Ok(())
}
fn load_function_handles ( binary : & [ u8 ] , table : & Table , function_handles : & mut Vec < FunctionHandle > , ) -> BinaryLoaderResult < ( ) > { let start = table . offset as usize ; let end = start + table . count as usize ; let mut cursor = Cursor :: new ( & binary [ start .. end ] ) ; loop { if cursor . position ( ) == u64 :: from ( table . count ) { break ; } let module_handle = read_uleb_u16_internal ( & mut cursor ) ? ; let name = read_uleb_u16_internal ( & mut cursor ) ? ; let parameters = read_uleb_u16_internal ( & mut cursor ) ? ; let return_ = read_uleb_u16_internal ( & mut cursor ) ? ; let type_parameters = load_kinds ( & mut cursor ) ? ; function_handles . push ( FunctionHandle { module : ModuleHandleIndex ( module_handle ) , name : IdentifierIndex ( name ) , parameters : SignatureIndex ( parameters ) , return_ : SignatureIndex ( return_ ) , type_parameters , } ) ; } Ok ( ( ) ) }
Builds the `FunctionHandle` table.
Builds the ` FunctionHandle ` table .
binary
&[u8]
table
&Table
function_handles
&mut Vec<FunctionHandle>
binary
&[u8]
table
&Table
function_handles
&mut Vec<FunctionHandle>