Skip to main content

HostMemory

Trait HostMemory 

Source
pub trait HostMemory: Send {
Show 16 methods // Required methods fn size_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, ) -> impl Future<Output = Result<u64>> + Send; fn page_size_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, ) -> impl Future<Output = Result<u64>> + Send; fn grow_to_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, delta: u64, ) -> impl Future<Output = Result<u64, Error>> + Send; fn get_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, len: u64, ) -> impl Future<Output = Result<Vec<u8>, Error>> + Send; fn set_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, bytes: Vec<u8>, ) -> impl Future<Output = Result<(), Error>> + Send; fn get_u8( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u8, Error>> + Send; fn get_u16( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u16, Error>> + Send; fn get_u32( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u32, Error>> + Send; fn get_u64( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u64, Error>> + Send; fn set_u8( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u8, ) -> impl Future<Output = Result<(), Error>> + Send; fn set_u16( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u16, ) -> impl Future<Output = Result<(), Error>> + Send; fn set_u32( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u32, ) -> impl Future<Output = Result<(), Error>> + Send; fn set_u64( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u64, ) -> impl Future<Output = Result<(), Error>> + Send; fn clone( &mut self, self_: Resource<Memory>, ) -> impl Future<Output = Result<Resource<Memory>>> + Send; fn unique_id( &mut self, self_: Resource<Memory>, ) -> impl Future<Output = Result<u64>> + Send; fn drop( &mut self, rep: Resource<Memory>, ) -> impl Future<Output = Result<()>> + Send;
}

Required Methods§

Source

fn size_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, ) -> impl Future<Output = Result<u64>> + Send

Get the current memory size, in bytes.

Source

fn page_size_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, ) -> impl Future<Output = Result<u64>> + Send

Get the page size, in bytes.

Source

fn grow_to_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, delta: u64, ) -> impl Future<Output = Result<u64, Error>> + Send

Increase size by the given delta. Returns the old size in bytes.

Source

fn get_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, len: u64, ) -> impl Future<Output = Result<Vec<u8>, Error>> + Send

Read len bytes starting at addr. Returns out-of-bounds if any byte in the range is out-of-bounds.

Source

fn set_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, bytes: Vec<u8>, ) -> impl Future<Output = Result<(), Error>> + Send

Write bytes starting at addr. Returns out-of-bounds if any byte in the range is out-of-bounds.

Source

fn get_u8( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u8, Error>> + Send

Get a u8 (byte) at an address. Returns none if out-of-bounds.

Source

fn get_u16( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u16, Error>> + Send

Get a u16 (in little endian order) at an address.

Source

fn get_u32( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u32, Error>> + Send

Get a u32 (in little endian order) at an address.

Source

fn get_u64( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u64, Error>> + Send

Get a u64 (in little endian order) at an address.

Source

fn set_u8( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u8, ) -> impl Future<Output = Result<(), Error>> + Send

Set a u8 (byte) at an address. Returns none if out-of-bounds.

Source

fn set_u16( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u16, ) -> impl Future<Output = Result<(), Error>> + Send

Set a u16 (in little endian order) at an address.

Source

fn set_u32( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u32, ) -> impl Future<Output = Result<(), Error>> + Send

Set a u32 (in little endian order) at an address.

Source

fn set_u64( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u64, ) -> impl Future<Output = Result<(), Error>> + Send

Set a u64 (in little endian order) at an address.

Source

fn clone( &mut self, self_: Resource<Memory>, ) -> impl Future<Output = Result<Resource<Memory>>> + Send

Clone this handle.

Source

fn unique_id( &mut self, self_: Resource<Memory>, ) -> impl Future<Output = Result<u64>> + Send

Get the unique ID of this memory to allow equality and hashing.

Source

fn drop( &mut self, rep: Resource<Memory>, ) -> impl Future<Output = Result<()>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl HostMemory for ResourceTable

Source§

async fn size_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, ) -> Result<u64>

Source§

async fn page_size_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, ) -> Result<u64>

Source§

async fn grow_to_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, delta_bytes: u64, ) -> Result<u64>

Source§

async fn get_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, len: u64, ) -> Result<Vec<u8>>

Source§

async fn set_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, bytes: Vec<u8>, ) -> Result<()>

Source§

async fn get_u8( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> Result<u8>

Source§

async fn get_u16( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> Result<u16>

Source§

async fn get_u32( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> Result<u32>

Source§

async fn get_u64( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> Result<u64>

Source§

async fn set_u8( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u8, ) -> Result<()>

Source§

async fn set_u16( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u16, ) -> Result<()>

Source§

async fn set_u32( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u32, ) -> Result<()>

Source§

async fn set_u64( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u64, ) -> Result<()>

Source§

async fn clone(&mut self, self_: Resource<Memory>) -> Result<Resource<Memory>>

Source§

async fn unique_id(&mut self, self_: Resource<Memory>) -> Result<u64>

Source§

async fn drop(&mut self, rep: Resource<Memory>) -> Result<()>

Source§

impl<_T: HostMemory + ?Sized + Send> HostMemory for &mut _T

Source§

fn size_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, ) -> impl Future<Output = Result<u64>> + Send

Get the current memory size, in bytes.

Source§

fn page_size_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, ) -> impl Future<Output = Result<u64>> + Send

Get the page size, in bytes.

Source§

fn grow_to_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, delta: u64, ) -> impl Future<Output = Result<u64, Error>> + Send

Increase size by the given delta. Returns the old size in bytes.

Source§

fn get_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, len: u64, ) -> impl Future<Output = Result<Vec<u8>, Error>> + Send

Read len bytes starting at addr. Returns out-of-bounds if any byte in the range is out-of-bounds.

Source§

fn set_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, bytes: Vec<u8>, ) -> impl Future<Output = Result<(), Error>> + Send

Write bytes starting at addr. Returns out-of-bounds if any byte in the range is out-of-bounds.

Source§

fn get_u8( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u8, Error>> + Send

Get a u8 (byte) at an address. Returns none if out-of-bounds.

Source§

fn get_u16( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u16, Error>> + Send

Get a u16 (in little endian order) at an address.

Source§

fn get_u32( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u32, Error>> + Send

Get a u32 (in little endian order) at an address.

Source§

fn get_u64( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> impl Future<Output = Result<u64, Error>> + Send

Get a u64 (in little endian order) at an address.

Source§

fn set_u8( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u8, ) -> impl Future<Output = Result<(), Error>> + Send

Set a u8 (byte) at an address. Returns none if out-of-bounds.

Source§

fn set_u16( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u16, ) -> impl Future<Output = Result<(), Error>> + Send

Set a u16 (in little endian order) at an address.

Source§

fn set_u32( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u32, ) -> impl Future<Output = Result<(), Error>> + Send

Set a u32 (in little endian order) at an address.

Source§

fn set_u64( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u64, ) -> impl Future<Output = Result<(), Error>> + Send

Set a u64 (in little endian order) at an address.

Source§

fn clone( &mut self, self_: Resource<Memory>, ) -> impl Future<Output = Result<Resource<Memory>>> + Send

Clone this handle.

Source§

fn unique_id( &mut self, self_: Resource<Memory>, ) -> impl Future<Output = Result<u64>> + Send

Get the unique ID of this memory to allow equality and hashing.

Source§

async fn drop(&mut self, rep: Resource<Memory>) -> Result<()>

Implementors§