[−][src]Struct evm_core::Memory
A sequencial memory. It uses Rust's Vec
for internal
representation.
Methods
impl Memory
[src]
pub fn new(limit: usize) -> Self
[src]
pub fn limit(&self) -> usize
[src]
pub fn len(&self) -> usize
[src]
Get the length of the current effective memory range.
pub fn is_empty(&self) -> bool
[src]
Return true if current effective memory range is zero.
pub fn resize(&mut self, size: usize) -> Result<(), ExitError>
[src]
Resize the current memory range to given length, aligned to next 32.
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<(), ExitError>
[src]
&mut self,
offset: usize,
value: &[u8],
target_size: Option<usize>
) -> Result<(), ExitError>
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<(), ExitError>
[src]
&mut self,
memory_offset: U256,
data_offset: U256,
len: U256,
data: &[u8]
) -> Result<(), ExitError>
Trait Implementations
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,