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§
Sourcefn size_bytes(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
) -> impl Future<Output = Result<u64>> + Send
fn size_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, ) -> impl Future<Output = Result<u64>> + Send
Get the current memory size, in bytes.
Sourcefn page_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
Get the page size, in bytes.
Sourcefn grow_to_bytes(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
delta: u64,
) -> impl Future<Output = Result<u64, Error>> + Send
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.
Sourcefn get_bytes(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
addr: u64,
len: u64,
) -> impl Future<Output = Result<Vec<u8>, 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
Read len bytes starting at addr. Returns out-of-bounds if any
byte in the range is out-of-bounds.
Sourcefn set_bytes(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
addr: u64,
bytes: Vec<u8>,
) -> impl Future<Output = Result<(), Error>> + Send
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.
Sourcefn get_u8(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
addr: u64,
) -> impl Future<Output = Result<u8, Error>> + Send
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.
Sourcefn get_u16(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
addr: u64,
) -> impl Future<Output = Result<u16, Error>> + Send
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.
Sourcefn get_u32(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
addr: u64,
) -> impl Future<Output = Result<u32, Error>> + Send
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.
Sourcefn get_u64(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
addr: u64,
) -> impl Future<Output = Result<u64, Error>> + Send
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.
Sourcefn set_u8(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
addr: u64,
value: u8,
) -> impl Future<Output = Result<(), Error>> + Send
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.
Sourcefn set_u16(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
addr: u64,
value: u16,
) -> 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
Set a u16 (in little endian order) at an address.
Sourcefn set_u32(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
addr: u64,
value: u32,
) -> 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
Set a u32 (in little endian order) at an address.
Sourcefn set_u64(
&mut self,
self_: Resource<Memory>,
d: Resource<Debuggee>,
addr: u64,
value: u64,
) -> 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
Set a u64 (in little endian order) at an address.
Sourcefn clone(
&mut self,
self_: Resource<Memory>,
) -> impl Future<Output = Result<Resource<Memory>>> + Send
fn clone( &mut self, self_: Resource<Memory>, ) -> impl Future<Output = Result<Resource<Memory>>> + Send
Clone this handle.
Sourcefn unique_id(
&mut self,
self_: Resource<Memory>,
) -> impl Future<Output = Result<u64>> + Send
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.
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
impl HostMemory for ResourceTable
async fn size_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, ) -> Result<u64>
async fn page_size_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, ) -> Result<u64>
async fn grow_to_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, delta_bytes: u64, ) -> Result<u64>
async fn get_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, len: u64, ) -> Result<Vec<u8>>
async fn set_bytes( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, bytes: Vec<u8>, ) -> Result<()>
async fn get_u8( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> Result<u8>
async fn get_u16( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> Result<u16>
async fn get_u32( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> Result<u32>
async fn get_u64( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, ) -> Result<u64>
async fn set_u8( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u8, ) -> Result<()>
async fn set_u16( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u16, ) -> Result<()>
async fn set_u32( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u32, ) -> Result<()>
async fn set_u64( &mut self, self_: Resource<Memory>, d: Resource<Debuggee>, addr: u64, value: u64, ) -> Result<()>
async fn clone(&mut self, self_: Resource<Memory>) -> Result<Resource<Memory>>
async fn unique_id(&mut self, self_: Resource<Memory>) -> Result<u64>
async fn drop(&mut self, rep: Resource<Memory>) -> Result<()>
Source§impl<_T: HostMemory + ?Sized + Send> HostMemory for &mut _T
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.