Skip to main content

AllocationCallbacks

Struct AllocationCallbacks 

Source
#[repr(C)]
pub struct AllocationCallbacks { pub p_user_data: *mut c_void, pub pfn_allocation: PFN_vkAllocationFunction, pub pfn_reallocation: PFN_vkReallocationFunction, pub pfn_free: PFN_vkFreeFunction, pub pfn_internal_allocation: PFN_vkInternalAllocationNotification, pub pfn_internal_free: PFN_vkInternalFreeNotification, }
Expand description

Native structure VkAllocationCallbacks.

Khronos reference: VkAllocationCallbacks

Fields§

§p_user_data: *mut c_void

Native field pUserData.

§pfn_allocation: PFN_vkAllocationFunction

Native field pfnAllocation.

§pfn_reallocation: PFN_vkReallocationFunction

Native field pfnReallocation.

§pfn_free: PFN_vkFreeFunction

Native field pfnFree.

§pfn_internal_allocation: PFN_vkInternalAllocationNotification

Native field pfnInternalAllocation.

§pfn_internal_free: PFN_vkInternalFreeNotification

Native field pfnInternalFree.

Implementations§

Source§

impl AllocationCallbacks

Source

pub fn new() -> Self

Construct the record with its default native state.

Source

pub unsafe fn set_user_data(self, value: *mut c_void) -> Self

Set native pointer pUserData explicitly. No borrow or extent is inferred.

§Safety

The caller must establish pointee validity, extent, alignment, aliasing and the full native retention lifetime before using this record in a native call. Callback, external-object and nested-pointer contracts remain caller obligations.

Source

pub fn set_pfn_allocation(self, value: PFN_vkAllocationFunction) -> Self

Set native field pfnAllocation without native effects.

Source

pub fn set_pfn_reallocation(self, value: PFN_vkReallocationFunction) -> Self

Set native field pfnReallocation without native effects.

Source

pub fn set_pfn_free(self, value: PFN_vkFreeFunction) -> Self

Set native field pfnFree without native effects.

Source

pub fn set_pfn_internal_allocation( self, value: PFN_vkInternalAllocationNotification, ) -> Self

Set native field pfnInternalAllocation without native effects.

Source

pub fn set_pfn_internal_free( self, value: PFN_vkInternalFreeNotification, ) -> Self

Set native field pfnInternalFree without native effects.

Trait Implementations§

Source§

impl Clone for AllocationCallbacks

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 Copy for AllocationCallbacks

Source§

impl Default for AllocationCallbacks

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.