Struct evm_coder::abi::AbiWriter

source ·
pub struct AbiWriter { /* private fields */ }
Expand description

Writer for RLP encoded data

Implementations§

source§

impl AbiWriter

source

pub fn new() -> Self

Initialize internal buffers for output data, assuming no padding required

source

pub fn new_dynamic(is_dynamic: bool) -> Self

Initialize internal buffers with data size

source

pub fn new_call(method_id: u32) -> Self

Initialize internal buffers, inserting method selector at beginning

source

pub fn address(&mut self, address: &H160)

Write H160 to end of buffer

source

pub fn bool(&mut self, value: &bool)

Write bool to end of buffer

source

pub fn uint8(&mut self, value: &u8)

Write u8 to end of buffer

source

pub fn uint32(&mut self, value: &u32)

Write u32 to end of buffer

source

pub fn uint64(&mut self, value: &u64)

Write u64 to end of buffer

source

pub fn uint128(&mut self, value: &u128)

Write u128 to end of buffer

source

pub fn uint256(&mut self, value: &U256)

Write U256 to end of buffer

source

pub fn write_usize(&mut self, value: &usize)

👎Deprecated: dangerous, as usize may have different width in wasm and native execution

Write usize to end of buffer

source

pub fn write_subresult(&mut self, result: Self)

Append recursive data, writing pending offset at end of buffer

source

pub fn string(&mut self, value: &str)

Append recursive str at end of buffer

source

pub fn bytes(&mut self, value: &[u8])

Append recursive [[u8]] at end of buffer

source

pub fn bytes_padleft(&mut self, block: &[u8])

Write [bytes] to end of buffer

source

pub fn finish(self) -> Vec<u8>

Finish writer, concatenating all internal buffers

Trait Implementations§

source§

impl Default for AbiWriter

source§

fn default() -> AbiWriter

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> JsonSchemaMaybe for T