[][src]Struct evm::Memory

pub struct Memory { /* fields omitted */ }

A sequencial memory. It uses Rust's Vec for internal representation.

Methods

impl Memory[src]

pub fn new(limit: usize) -> Memory[src]

pub fn limit(&self) -> usize[src]

pub fn len(&self) -> usize[src]

Get the length of the current memory range.

pub fn effective_len(&self) -> U256[src]

Get the effective length.

pub fn is_empty(&self) -> bool[src]

Return true if current effective memory range is zero.

pub fn resize_offset(
    &mut self,
    offset: U256,
    len: U256
) -> Result<(), ExitError>
[src]

pub fn resize_end(&mut self, end: U256) -> Result<(), ExitError>[src]

pub fn get(&self, offset: usize, size: usize) -> Vec<u8>[src]

Get memory region at given offset.

Panics

Value of size is considered trusted. If they're too large, the program can run out of memory, or it can overflow.

pub fn set(
    &mut self,
    offset: usize,
    value: &[u8],
    target_size: Option<usize>
) -> Result<(), ExitFatal>
[src]

Set memory region at given offset. The offset and value is considered untrusted.

pub fn copy_large(
    &mut self,
    memory_offset: U256,
    data_offset: U256,
    len: U256,
    data: &[u8]
) -> Result<(), ExitFatal>
[src]

Trait Implementations

impl Debug for Memory[src]

impl Clone for Memory[src]

Auto Trait Implementations

impl Send for Memory

impl Sync for Memory

impl Unpin for Memory

impl UnwindSafe for Memory

impl RefUnwindSafe for Memory

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self