Struct fuels_core::abi_decoder::ABIDecoder
source · pub struct ABIDecoder;Implementations§
source§impl ABIDecoder
impl ABIDecoder
sourcepub fn decode(param_types: &[ParamType], bytes: &[u8]) -> Result<Vec<Token>>
pub fn decode(param_types: &[ParamType], bytes: &[u8]) -> Result<Vec<Token>>
Decodes types described by param_types into their respective Tokens
using the data in bytes and receipts.
Arguments
param_types: The ParamType’s of the types we expect are encoded insidebytesandreceipts.bytes: The bytes to be used in the decoding process.
Examples
use fuels_core::abi_decoder::ABIDecoder;
use fuels_types::{Token, param_types::ParamType};
let tokens = ABIDecoder::decode(&[ParamType::U8, ParamType::U8], &[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2]).unwrap();
assert_eq!(tokens, vec![Token::U8(1), Token::U8(2)])Auto Trait Implementations§
impl RefUnwindSafe for ABIDecoder
impl Send for ABIDecoder
impl Sync for ABIDecoder
impl Unpin for ABIDecoder
impl UnwindSafe for ABIDecoder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more