pub unsafe trait StructureChainOut<H>: Sizedwhere
H: ExtendableStructure,{
// 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§
Sourcefn setup_uninit(chain: &mut MaybeUninit<Self>)
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
Sourcefn get_uninit_head_ptr(chain: *mut Self) -> *mut H
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§
Sourcefn setup_cleanup(chain: *mut Self)
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.