pub struct Memory(/* private fields */);
Expand description
Memory for temporary storage of words.
Implementations§
Source§impl Memory
impl Memory
Sourcepub const SIZE_LIMIT: usize = 10_240usize
pub const SIZE_LIMIT: usize = 10_240usize
The maximum number of words that can be stored in memory.
Sourcepub fn alloc(&mut self, size: Word) -> OpResult<()>
pub fn alloc(&mut self, size: Word) -> OpResult<()>
Allocate more memory to the end of this memory.
Sourcepub fn store(&mut self, address: Word, value: Word) -> OpResult<()>
pub fn store(&mut self, address: Word, value: Word) -> OpResult<()>
Store a word at the given address.
Sourcepub fn store_range(&mut self, address: Word, values: &[Word]) -> OpResult<()>
pub fn store_range(&mut self, address: Word, values: &[Word]) -> OpResult<()>
Store a range of words starting at the given address.
Sourcepub fn load_range(&mut self, address: Word, size: Word) -> OpResult<Vec<Word>>
pub fn load_range(&mut self, address: Word, size: Word) -> OpResult<Vec<Word>>
Load a range of words starting at the given address.
Trait Implementations§
impl StructuralPartialEq for Memory
Auto Trait Implementations§
impl Freeze for Memory
impl RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnwindSafe for Memory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more