Trait OuterVm

Source
pub trait OuterVm {
    type InnerVm: InnerVm;

    // Required methods
    fn import(&mut self, i: usize) -> Option<PageSegment>;
    fn export(&mut self, segment: &[u8]) -> Result<(), ApiError>;
    fn lookup(&mut self, service_id: ServiceId, hash: &Hash) -> Option<Vec<u8>>;
    fn get_export_count(&mut self) -> u16;
    fn get_auth_output_len(&mut self) -> u32;
    fn machine(
        &mut self,
        code: &[u8],
        program_counter: u64,
    ) -> Result<Self::InnerVm, ApiError>;

    // Provided method
    fn read_file(&mut self, file: &FileRef) -> Option<Vec<u8>> { ... }
}

Required Associated Types§

Required Methods§

Source

fn import(&mut self, i: usize) -> Option<PageSegment>

Source

fn export(&mut self, segment: &[u8]) -> Result<(), ApiError>

Source

fn lookup(&mut self, service_id: ServiceId, hash: &Hash) -> Option<Vec<u8>>

Source

fn get_export_count(&mut self) -> u16

Source

fn get_auth_output_len(&mut self) -> u32

Source

fn machine( &mut self, code: &[u8], program_counter: u64, ) -> Result<Self::InnerVm, ApiError>

Provided Methods§

Source

fn read_file(&mut self, file: &FileRef) -> Option<Vec<u8>>

Implementors§