Skip to main content

Transport

Trait Transport 

Source
pub trait Transport {
    // Required methods
    fn word_bits(&self) -> u32;
    fn bytes(&self, address: Word, length: usize) -> Result<&[u8]>;
    fn bytes_mut(&mut self, address: Word, length: usize) -> Result<&mut [u8]>;
    fn c_string(&self, address: Word, limit: usize) -> Result<&CStr>;
}
Expand description

Argument memory of one caller.

Required Methods§

Source

fn word_bits(&self) -> u32

Width in bits of the caller’s pointer-sized word, 32 or 64, never wider than the host’s usize. It tells a zero-extended 32-bit word from a sign-extended 64-bit one.

Source

fn bytes(&self, address: Word, length: usize) -> Result<&[u8]>

Borrow length bytes at address. A null address is valid only for an empty range.

Source

fn bytes_mut(&mut self, address: Word, length: usize) -> Result<&mut [u8]>

Exclusively borrow length bytes at address.

Source

fn c_string(&self, address: Word, limit: usize) -> Result<&CStr>

Borrow the NUL-terminated string at address without copying it. A string longer than limit bytes, NUL included, is ResourceLimit; a null address or a string that leaves memory is InvalidMemory.

Implementors§