pub struct Memory<'a> { /* private fields */ }
Expand description
A memory on a virtual machine.
Implementations§
source§impl<'a> Memory<'a>
impl<'a> Memory<'a>
sourcepub fn set_register(&mut self, value: Cons)
pub fn set_register(&mut self, value: Cons)
Sets a register.
sourcepub fn pop_numbers<const M: usize>(&mut self) -> [Number; M]
pub fn pop_numbers<const M: usize>(&mut self) -> [Number; M]
Pops numbers from a stack.
sourcepub fn allocate(&mut self, car: Value, cdr: Value) -> Result<Cons, Error>
pub fn allocate(&mut self, car: Value, cdr: Value) -> Result<Cons, Error>
Allocates a cons on heap.
sourcepub fn car_value(&self, cons: Value) -> Value
pub fn car_value(&self, cons: Value) -> Value
Returns a value of a car
field in a value assumed as a cons.
sourcepub fn cdr_value(&self, cons: Value) -> Value
pub fn cdr_value(&self, cons: Value) -> Value
Returns a value of a cdr
field in a value assumed as a cons.
sourcepub fn set_car_value(&mut self, cons: Value, value: Value)
pub fn set_car_value(&mut self, cons: Value, value: Value)
Sets a value to a car
field in a value assumed as a cons.
sourcepub fn set_cdr_value(&mut self, cons: Value, value: Value)
pub fn set_cdr_value(&mut self, cons: Value, value: Value)
Sets a value to a cdr
field in a value assumed as a cons.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Memory<'a>
impl<'a> RefUnwindSafe for Memory<'a>
impl<'a> Send for Memory<'a>
impl<'a> Sync for Memory<'a>
impl<'a> Unpin for Memory<'a>
impl<'a> !UnwindSafe for Memory<'a>
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