Trait vk_alloc::AllocationInfo[][src]

pub trait AllocationInfo {
    fn memory(&self) -> DeviceMemory;
fn offset(&self) -> u64;
fn size(&self) -> u64;
fn mapped_ptr(&self) -> Option<NonNull<c_void>>; fn mapped_slice(&self) -> Option<&[u8]> { ... }
fn mapped_slice_mut(&mut self) -> Option<&mut [u8]> { ... } }

Trait to get the memory, offset, size and mapped pointer of an allocation.

Required methods

fn memory(&self) -> DeviceMemory[src]

The vk::DeviceMemory of the allocation. Managed by the allocator.

fn offset(&self) -> u64[src]

The offset inside the vk::DeviceMemory.

fn size(&self) -> u64[src]

The size of the allocation.

fn mapped_ptr(&self) -> Option<NonNull<c_void>>[src]

Returns a pointer into the mapped memory if it is host visible, otherwise returns None.

Loading content...

Provided methods

fn mapped_slice(&self) -> Option<&[u8]>[src]

Returns a valid mapped slice if the memory is host visible, otherwise it will return None. The slice already references the exact memory region of the sub allocation, so no offset needs to be applied.

fn mapped_slice_mut(&mut self) -> Option<&mut [u8]>[src]

Returns a valid mapped mutable slice if the memory is host visible, otherwise it will return None. The slice already references the exact memory region of the sub allocation, so no offset needs to be applied.

Loading content...

Implementors

impl AllocationInfo for Allocation[src]

fn memory(&self) -> DeviceMemory[src]

The vk::DeviceMemory of the allocation. Managed by the allocator.

fn offset(&self) -> u64[src]

The offset inside the vk::DeviceMemory.

fn size(&self) -> u64[src]

The size of the allocation.

fn mapped_ptr(&self) -> Option<NonNull<c_void>>[src]

Returns a pointer into the mapped memory if it is host visible, otherwise returns None.

impl AllocationInfo for LinearAllocation[src]

fn memory(&self) -> DeviceMemory[src]

The vk::DeviceMemory of the allocation. Managed by the allocator.

fn offset(&self) -> u64[src]

The offset inside the vk::DeviceMemory.

fn size(&self) -> u64[src]

The size of the allocation.

fn mapped_ptr(&self) -> Option<NonNull<c_void>>[src]

Returns a pointer into the mapped memory if it is host visible, otherwise returns None.

Loading content...