/// Parses a WebAssembly data component from the input.
///
/// See <https://webassembly.github.io/spec/core/binary/modules.html#data-section>
Parses a WebAssembly data component from the input.
See
Parses a WebAssembly data component from the input . See
pub fn parse_data(input: &[u8]) -> IResult<&[u8], Data> {
    alt((
        map(
            preceded(
                match_byte(0x00),
                tuple((parse_expression, parse_byte_vector)),
            ),
            |(offset, bytes)| Data::active(0, offset, bytes.into()),
        ),
        map(preceded(match_byte(0x01), parse_byte_vector), |bytes| {
            Data::passive(bytes.into())
        }),
        map(
            preceded(
                match_byte(0x02),
                tuple((parse_u32, parse_expression, parse_byte_vector)),
            ),
            |(memory, offset, bytes)| Data::active(memory, offset, bytes.into()),
        ),
    ))(input)
}
pub fn parse_data ( input : & [ u8 ] ) -> IResult < & [ u8 ] , Data > { alt ( ( map ( preceded ( match_byte ( 0x00 ) , tuple ( ( parse_expression , parse_byte_vector ) ) , ) , | ( offset , bytes ) | Data :: active ( 0 , offset , bytes . into ( ) ) , ) , map ( preceded ( match_byte ( 0x01 ) , parse_byte_vector ) , | bytes | { Data :: passive ( bytes . into ( ) ) } ) , map ( preceded ( match_byte ( 0x02 ) , tuple ( ( parse_u32 , parse_expression , parse_byte_vector ) ) , ) , | ( memory , offset , bytes ) | Data :: active ( memory , offset , bytes . into ( ) ) , ) , ) ) ( input ) }
Parses a WebAssembly data component from the input.
Parses a WebAssembly data component from the input .
input
&[u8]