Trait linera_witty::RuntimeMemory

source ·
pub trait RuntimeMemory<Instance> {
    // Required methods
    fn read<'instance>(
        &self,
        instance: &'instance Instance,
        location: GuestPointer,
        length: u32
    ) -> Result<Cow<'instance, [u8]>, RuntimeError>;
    fn write(
        &mut self,
        instance: &mut Instance,
        location: GuestPointer,
        bytes: &[u8]
    ) -> Result<(), RuntimeError>;
}
Expand description

Interface for accessing a runtime specific memory.

Required Methods§

source

fn read<'instance>( &self, instance: &'instance Instance, location: GuestPointer, length: u32 ) -> Result<Cow<'instance, [u8]>, RuntimeError>

Reads length bytes from memory from the provided location.

source

fn write( &mut self, instance: &mut Instance, location: GuestPointer, bytes: &[u8] ) -> Result<(), RuntimeError>

Writes the bytes to memory at the provided location.

Implementors§

source§

impl<M, I> RuntimeMemory<&mut I> for M
where M: RuntimeMemory<I>,