Trait StructureChainOut

Source
pub unsafe trait StructureChainOut<H>: Sized{
    // Required methods
    fn setup_uninit(chain: &mut MaybeUninit<Self>);
    fn get_uninit_head_ptr(chain: *mut Self) -> *mut H;

    // Provided method
    fn setup_cleanup(chain: *mut Self) { ... }
}
Expand description

Represent an object that can be used as the return value of a vulkan function that outputs a structure chain It must therefore internally represent what vulkan recognizes as a structure chain

Required Methods§

Source

fn setup_uninit(chain: &mut MaybeUninit<Self>)

Setup an uninitialized structure chain After this call, for the structure chain to be initialized, each structure field (with the exception of the structure type and the p_next pointer) must be initialized (usually by calling the appropriate vulkan command) The structure type and p_next pointer of each struct are set so that a vulkan commands sees a pointer to the head as a valid chain containing all structures Calling setup_uninit should be enough to then call a vulkan command filling this structure chain, moreover after the call to this vulkan command, the whole structure chain should be considered initialized

Source

fn get_uninit_head_ptr(chain: *mut Self) -> *mut H

Return a mutable pointer to the head structure, which can then be passed to vulkan commands

Provided Methods§

Source

fn setup_cleanup(chain: *mut Self)

Function to call after a vulkan function initialized this structure to make sure there is no dangling pointer or anything which could cause 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<H> StructureChainOut<H> for (H,)

Source§

impl<H, V1> StructureChainOut<H> for (H, V1)

Source§

impl<H, V1, V2> StructureChainOut<H> for (H, V1, V2)

Source§

impl<H, V1, V2, V3> StructureChainOut<H> for (H, V1, V2, V3)

Source§

impl<H, V1, V2, V3, V4> StructureChainOut<H> for (H, V1, V2, V3, V4)

Source§

impl<H, V1, V2, V3, V4, V5> StructureChainOut<H> for (H, V1, V2, V3, V4, V5)

Source§

impl<H, V1, V2, V3, V4, V5, V6> StructureChainOut<H> for (H, V1, V2, V3, V4, V5, V6)

Implementors§