Struct vk_alloc::Allocation[][src]

pub struct Allocation {
    pub device_memory: DeviceMemory,
    pub offset: u64,
    pub size: u64,
    pub mapped_ptr: Option<NonNull<c_void>>,
    // some fields omitted
}

An allocation of the Allocator.

Fields

device_memory: DeviceMemory

The DeviceMemory of the allocation. Managed by the allocator.

offset: u64

The offset inside the DeviceMemory.

size: u64

The size of the allocation.

mapped_ptr: Option<NonNull<c_void>>

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

Implementations

impl Allocation[src]

pub 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.

pub 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.

Trait Implementations

impl Clone for Allocation[src]

impl Debug for Allocation[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.