pub struct MappedMemory<'m, DeviceMemory: DeviceMemoryMut + ?Sized + 'm>(/* private fields */);Expand description
Specifies the block of mapped memory in a DeviceMemory
Implementations§
Source§impl<'m, DeviceMemory: DeviceMemoryMut + ?Sized + 'm> MappedMemory<'m, DeviceMemory>
impl<'m, DeviceMemory: DeviceMemoryMut + ?Sized + 'm> MappedMemory<'m, DeviceMemory>
Sourcepub const unsafe fn addr_of_mut<T>(&self, offset: usize) -> *mut T
pub const unsafe fn addr_of_mut<T>(&self, offset: usize) -> *mut T
Get a mutable pointer in mapped memory with byte offsets
§Safety
Caller must guarantee that the pointer and its alignment are valid
Sourcepub const unsafe fn get<T>(&self, offset: usize) -> &T
pub const unsafe fn get<T>(&self, offset: usize) -> &T
Get a reference in mapped memory with byte offsets
§Safety
Caller must guarantee that the pointer and its alignment are valid
Sourcepub const unsafe fn get_mut<T>(&self, offset: usize) -> &mut T
pub const unsafe fn get_mut<T>(&self, offset: usize) -> &mut T
Get a mutable reference in mapped memory with byte offsets
§Safety
Caller must guarantee that the pointer and its alignment are valid
Sourcepub const unsafe fn slice<T>(&self, offset: usize, count: usize) -> &[T]
pub const unsafe fn slice<T>(&self, offset: usize, count: usize) -> &[T]
Get a slice in mapped memory with byte offsets
§Safety
Caller must guarantee that the pointer and its alignment are valid
Sourcepub const unsafe fn slice_mut<T>(&self, offset: usize, count: usize) -> &mut [T]
pub const unsafe fn slice_mut<T>(&self, offset: usize, count: usize) -> &mut [T]
Get a mutable slice in mapped memory with byte offsets
§Safety
Caller must guarantee that the pointer and its alignment are valid
Sourcepub unsafe fn clone_from_slice_at<T: Clone>(&self, offset: usize, src: &[T])
pub unsafe fn clone_from_slice_at<T: Clone>(&self, offset: usize, src: &[T])
Clone data from slice at the specified offset in mapped memory.
§Safety
Caller must guarantee that the pointer and its alignment are valid