pub trait MemoryReadExt: MemoryRead {
// Provided methods
fn try_read<T: Pod>(&self, address: u64) -> Option<T> { ... }
unsafe fn try_read_unchecked<T>(&self, address: u64) -> Option<T> { ... }
fn read<T: Pod>(&self, address: u64) -> T { ... }
fn try_read_bytes_const<const LEN: usize>(
&self,
address: u64,
) -> Option<[u8; LEN]> { ... }
fn try_read_bytes_into_chunked<const CHUNK_SIZE: usize>(
&self,
address: u64,
buf: &mut [u8],
) -> Option<()> { ... }
fn try_read_bytes_into_chunked_fallible<const CHUNK_SIZE: usize>(
&self,
address: u64,
buf: &mut [u8],
) -> Option<usize> { ... }
}
Expand description
Extension trait for supplying generic util methods for MemoryRead
Provided Methods§
Sourcefn try_read<T: Pod>(&self, address: u64) -> Option<T>
fn try_read<T: Pod>(&self, address: u64) -> Option<T>
Reads bytes from the process at the specified address into a value of type T. Returns None if the address is not valid
Sourceunsafe fn try_read_unchecked<T>(&self, address: u64) -> Option<T>
unsafe fn try_read_unchecked<T>(&self, address: u64) -> Option<T>
Reads any type T from the process without the restriction of Pod
Sourcefn read<T: Pod>(&self, address: u64) -> T
fn read<T: Pod>(&self, address: u64) -> T
Reads bytes from the process at the specified address into a value of type T. Panics if the address is not valid
Sourcefn try_read_bytes_const<const LEN: usize>(
&self,
address: u64,
) -> Option<[u8; LEN]>
fn try_read_bytes_const<const LEN: usize>( &self, address: u64, ) -> Option<[u8; LEN]>
Reads a const number of bytes from the process returning a stack allocated array.
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.