Function parse_query_return_bytes_data

Source
pub fn parse_query_return_bytes_data<T: NativeConvertible + TopDecodeMulti>(
    data: &mut Vec<Vec<u8>>,
) -> Result<T, DataError>
Expand description

Parses and decodes a vector of byte vectors obtained from a blockchain gateway query, or a mocked environment, into a native Rust type.

This function utilizes the TopDecodeMulti trait to parse the byte data into the desired native type T.

§Type Parameters

  • T: The native Rust type to which the data should be parsed, which must implement both NativeConvertible and TopDecodeMulti traits.

§Parameters

  • data: A mutable reference to a vector of byte vectors representing the data to be parsed.

§Returns

A Result containing the parsed native type, or a DataError if parsing fails.