Struct revm_interpreter::Memory
source · pub struct Memory { /* private fields */ }
Expand description
A sequencial memory. It uses Rust’s Vec
for internal
representation.
Implementations§
source§impl Memory
impl Memory
pub fn effective_len(&self) -> usize
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the data buffer as much as possible.
sourcepub fn resize(&mut self, new_size: usize)
pub fn resize(&mut self, new_size: usize)
Resize the memory. asume that we already checked if we have enought gas to resize this vector and that we made new_size as multiply of 32
sourcepub fn get_slice(&self, offset: usize, size: usize) -> &[u8] ⓘ
pub fn get_slice(&self, offset: usize, size: usize) -> &[u8] ⓘ
Get memory region at given offset. Dont check offset and size
sourcepub unsafe fn set_byte(&mut self, index: usize, byte: u8)
pub unsafe fn set_byte(&mut self, index: usize, byte: u8)
Set memory region at given offset
Safety
The caller is responsible for checking the offset and value
pub fn set_u256(&mut self, index: usize, value: U256)
Trait Implementations§
source§impl PartialEq<Memory> for Memory
impl PartialEq<Memory> for Memory
impl Eq for Memory
impl StructuralEq for Memory
impl StructuralPartialEq for Memory
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more