Skip to main content

WriteToMemory

Trait WriteToMemory 

Source
pub unsafe trait WriteToMemory {
    // Required method
    fn write_to_memory(address: usize, value: Self)
       where Self: Sized;
}
Expand description

This trait provides an ability to write a value of type Self into memory at the given address.

§Examples

To use it simply call it with :

fn main() {
    // This write a u16 of value 10 in the 0x1000 internal memory address
    ReadFromMemory::write(0x1000, 10u16);
}

Required Methods§

Source

fn write_to_memory(address: usize, value: Self)
where Self: Sized,

Writes the value into memory at the specified address.

§Arguments
  • address - The destination address in memory to write to.
  • value - The value to write to memory.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl WriteToMemory for &[f32]

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for &[f64]

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for &[i8]

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for &[i16]

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for &[i32]

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for &[i64]

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for &[u8]

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for &[u16]

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for &[u32]

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for &[u64]

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for String

Caution: This code assumes the use of ASCII characters only. ⚠️

To handle strings with a different character encoding, first convert the string to a byte array using the WriteToMemory::<&u8>() method, and then convert it to your desired string format.

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for bool

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for f32

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for f64

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for i8

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for i16

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for i32

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for i64

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for isize

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for u8

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for u16

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for u32

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for u64

Source§

fn write_to_memory(address: usize, value: Self)

Source§

impl WriteToMemory for usize

Source§

fn write_to_memory(address: usize, value: Self)

Implementors§