rendy_memory

Trait Write

Source
pub trait Write<T: Copy> {
    // Required method
    unsafe fn slice(&mut self) -> &mut [T];

    // Provided method
    fn write(&mut self, data: &[T]) { ... }
}
Expand description

Trait for memory region suitable for host writes.

Required Methods§

Source

unsafe fn slice(&mut self) -> &mut [T]

Get mutable slice of T bound to mapped range.

§Safety
  • Returned slice should not be read.

Provided Methods§

Source

fn write(&mut self, data: &[T])

Write data into mapped memory sub-region.

§Panic

Panics if data.len() is greater than this sub-region len.

Implementors§