pub trait ReadMemory {
// Required methods
fn get(&self, addr: &Address) -> Option<&Primitive>;
fn get_composite<T: Value>(
&self,
start: Address
) -> Result<(T, usize), MemoryError>;
fn stack_pop(&mut self) -> Result<Vec<Primitive>, MemoryError>;
fn stack_peek(&self) -> Result<Vec<Primitive>, MemoryError>;
// Provided method
fn get_ok(&self, address: &Address) -> Result<Vec<Primitive>, MemoryError> { ... }
}
Expand description
Memory that a KittyCAD Execution Plan can read from.
Required Methods§
sourcefn get_composite<T: Value>(
&self,
start: Address
) -> Result<(T, usize), MemoryError>
fn get_composite<T: Value>( &self, start: Address ) -> Result<(T, usize), MemoryError>
Get a value from the given starting address. Value might require multiple addresses.
sourcefn stack_pop(&mut self) -> Result<Vec<Primitive>, MemoryError>
fn stack_pop(&mut self) -> Result<Vec<Primitive>, MemoryError>
Remove the value on top of the stack, return it.
sourcefn stack_peek(&self) -> Result<Vec<Primitive>, MemoryError>
fn stack_peek(&self) -> Result<Vec<Primitive>, MemoryError>
Return the value on top of the stack.
Provided Methods§
Object Safety§
This trait is not object safe.