Trait DeviceMemoryMut

Source
pub trait DeviceMemoryMut: DeviceMemory + VkHandleMut {
    // Provided methods
    unsafe fn map_raw(
        &mut self,
        range: Range<VkDeviceSize>,
    ) -> Result<*mut c_void> { ... }
    fn map(&mut self, range: Range<usize>) -> Result<MappedMemory<'_, Self>> { ... }
    unsafe fn unmap(&mut self) { ... }
}

Provided Methods§

Source

unsafe fn map_raw(&mut self, range: Range<VkDeviceSize>) -> Result<*mut c_void>

Map a memory object into application address space

§Safety

mapped memory must be unmapped once

§Failure

On failure, this command returns

  • VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY
  • VK_ERROR_MEMORY_MAP_FAILED
Source

fn map(&mut self, range: Range<usize>) -> Result<MappedMemory<'_, Self>>

Map a memory object into application address space

§Failure

On failure, this command returns

  • VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY
  • VK_ERROR_MEMORY_MAP_FAILED
Source

unsafe fn unmap(&mut self)

Unmap a previously mapped memory object

§Safety

Caller must guarantee that there is no MappedMemoryRange alives. Accessing the mapped memory after this call has undefined behavior

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<'s, T> DeviceMemoryMut for &'s mut T
where T: DeviceMemoryMut + ?Sized,

Source§

impl<T> DeviceMemoryMut for Box<T>
where T: DeviceMemoryMut + ?Sized,

Source§

impl<T> DeviceMemoryMut for RefMut<'_, T>
where T: DeviceMemoryMut + ?Sized,

Source§

impl<T> DeviceMemoryMut for ManuallyDrop<T>
where T: DeviceMemoryMut,

Source§

impl<T> DeviceMemoryMut for MutexGuard<'_, T>
where T: DeviceMemoryMut + ?Sized,

Source§

impl<T> DeviceMemoryMut for RwLockWriteGuard<'_, T>
where T: DeviceMemoryMut + ?Sized,

Source§

impl<T> DeviceMemoryMut for MappedMutexGuard<'_, T>
where T: DeviceMemoryMut + ?Sized,

Source§

impl<T> DeviceMemoryMut for MutexGuard<'_, T>
where T: DeviceMemoryMut + ?Sized,

Source§

impl<T> DeviceMemoryMut for MappedRwLockWriteGuard<'_, T>
where T: DeviceMemoryMut + ?Sized,

Source§

impl<T> DeviceMemoryMut for RwLockWriteGuard<'_, T>
where T: DeviceMemoryMut + ?Sized,

Implementors§

Source§

impl<Device: VkHandle<Handle = VkDevice>> DeviceMemoryMut for DeviceMemoryObject<Device>