Struct evm_runtime::Memory [−][src]
A sequencial memory. It uses Rust’s Vec
for internal
representation.
Implementations
impl Memory
[src]
pub fn new(limit: usize) -> Memory
[src]
Create a new memory with the given limit.
pub fn limit(&self) -> usize
[src]
Memory limit.
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]
&mut self,
offset: U256,
len: U256
) -> Result<(), ExitError>
Resize the memory, making it cover the memory region of offset..(offset + len)
, with 32 bytes as the step. If the length is zero, this function
does nothing.
pub fn resize_end(&mut self, end: U256) -> Result<(), ExitError>
[src]
Resize the memory, making it cover to end
, with 32 bytes as the step.
pub fn get(&self, offset: usize, size: usize) -> Vec<u8, Global>
[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]
&mut self,
offset: usize,
value: &[u8],
target_size: Option<usize>
) -> Result<(), ExitFatal>
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]
&mut self,
memory_offset: U256,
data_offset: U256,
len: U256,
data: &[u8]
) -> Result<(), ExitFatal>
Copy data
into the memory, of given len
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnwindSafe for Memory
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,