Trait aluvm::Program

source ·
pub trait Program {
    type Isa: InstructionSet;
    type Iter<'a>: Iterator<Item = &'a Lib>
       where Self: 'a;

    // Required methods
    fn lib_count(&self) -> u16;
    fn libs(&self) -> Self::Iter<'_>;
    fn lib(&self, id: LibId) -> Option<&Lib>;
    fn entrypoint(&self) -> LibSite;
}
Expand description

Trait for a concrete program implementation provided by a runtime environment.

Required Associated Types§

source

type Isa: InstructionSet

Instruction set architecture used by the program.

source

type Iter<'a>: Iterator<Item = &'a Lib> where Self: 'a

Iterator type over libraries

Required Methods§

source

fn lib_count(&self) -> u16

Returns number of libraries used by the program.

source

fn libs(&self) -> Self::Iter<'_>

Returns an iterator over libraries used by the program.

source

fn lib(&self, id: LibId) -> Option<&Lib>

Returns library corresponding to the provided LibId, if the library is known to the program.

source

fn entrypoint(&self) -> LibSite

Main entry point into the program.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Isa, const RUNTIME_MAX_TOTAL_LIBS: u16> Program for Prog<Isa, RUNTIME_MAX_TOTAL_LIBS>where Isa: InstructionSet,

§

type Isa = Isa

§

type Iter<'a> = Values<'a, LibId, Lib> where Self: 'a