stak_vm

Trait PrimitiveSet

source
pub trait PrimitiveSet: Sized {
    type Error: From<Error> + Error;

    // Required method
    fn operate(
        &mut self,
        memory: &mut Memory<'_>,
        primitive: usize,
    ) -> Result<(), Self::Error>;
}
Expand description

A primitive set.

PrimitiveSets provide primitive functionalities, such as arithmetic and I/O, to Vms. Each primitive has its own identifier.

Required Associated Types§

source

type Error: From<Error> + Error

An error.

Required Methods§

source

fn operate( &mut self, memory: &mut Memory<'_>, primitive: usize, ) -> Result<(), Self::Error>

Runs a primitive on a virtual machine.

Object Safety§

This trait is not object safe.

Implementors§