Skip to main content

AllocationChain

Struct AllocationChain 

Source
pub struct AllocationChain<'a> { /* private fields */ }
Expand description

A caller-owned VkMemoryAllocateInfo::pNext chain.

The allocator prepends its dedication and admitted priority/address records. Explicit flags are preserved, including a device mask; resource dedication and priority belong to the allocator and must not also appear in this chain. No native handle is owned by this borrowed descriptor.

Implementations§

Source§

impl<'a> AllocationChain<'a>

Source

pub unsafe fn new_from_record<T: Extends<MemoryAllocateInfo<'a>>>( record: &'a T, ) -> Result<Self, AllocError>

Borrow a registered allocation extension and its linked records.

§Errors

Rejects cycles, duplicate tags, overlong chains, allocator-owned records and native records without an admitted allocator ownership/accounting contract.

§Safety

Every reachable header and full payload must be valid, correctly tagged, immutable and readable for 'a; all nested pointers/handles and enabled capabilities must meet native valid usage at allocation. Imports must use an explicitly compatible memory type/size. Native import handle transfer occurs on successful vkAllocateMemory, even if later mapping/binding fails.

Source

pub unsafe fn new_from_record_with_import<T: Extends<MemoryAllocateInfo<'a>>>( record: &'a T, info: ImportMemoryInfo, ) -> Result<Self, AllocError>

Borrow an import chain with explicit external payload accounting.

Use this for platform imports whose native allocation size is ignored or whose compatible types come from external properties. No OS query is guessed.

§Errors

Same chain validation as new_from_record, plus absent/invalid import metadata, null resource identities and incompatible dedication policy.

§Safety

The complete new_from_record contract applies. info must describe this exact payload and device: obtain size/types from the platform Vulkan query or authoritative OS/export metadata. Include all backing bytes, even when native allocationSize is ignored/zero. A supplied resource must be live, unbound, compatible, and have requirements covered by this size/type mask. Every native dedication rule still applies, including an exact requirements size wherever required. Fuchsia collection resource/index/size must match. Android/QNX/OHOS image profiles and Metal textures require their image. External host/OS objects must survive every native use, not just this borrow.

Source

pub fn as_ptr(&self) -> *const c_void

Trait Implementations§

Source§

impl<'a> Clone for AllocationChain<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for AllocationChain<'a>

Source§

impl<'a> Debug for AllocationChain<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Send for AllocationChain<'a>

§

impl<'a> !Sync for AllocationChain<'a>

§

impl<'a> Forget for AllocationChain<'a>

§

impl<'a> Freeze for AllocationChain<'a>

§

impl<'a> Move for AllocationChain<'a>

§

impl<'a> RefUnwindSafe for AllocationChain<'a>

§

impl<'a> Unpin for AllocationChain<'a>

§

impl<'a> UnsafeUnpin for AllocationChain<'a>

§

impl<'a> UnwindSafe for AllocationChain<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.