Trait Instance

Source
pub trait Instance: VkHandle<Handle = VkInstance> {
    // Provided methods
    fn extra_procedure(&self, name: &CStr) -> Option<PFN_vkVoidFunction> { ... }
    fn physical_device_count(&self) -> Result<u32> { ... }
    fn enumerate_physical_devices(
        &self,
        sink: &mut [VkPhysicalDevice],
    ) -> Result<u32> { ... }
    fn iter_physical_devices(&self) -> Result<IterPhysicalDevices<'_, Self>> { ... }
    fn enumerate_physical_devices_alloc(
        &self,
    ) -> Result<Vec<PhysicalDeviceObject<&Self>>> { ... }
}
Expand description

A Vulkan Instance interface

Provided Methodsยง

Source

fn extra_procedure(&self, name: &CStr) -> Option<PFN_vkVoidFunction>

๐Ÿ‘ŽDeprecated: do not use this directly(this does not provide caching!)
Available on crate feature Implements only.

Return a function pointer for a command

Source

fn physical_device_count(&self) -> Result<u32>

Available on crate feature Implements only.

Counts the physical devices accessible to a Vulkan instance

ยงFailures

On failure, this command returns

Source

fn enumerate_physical_devices( &self, sink: &mut [VkPhysicalDevice], ) -> Result<u32>

Available on crate feature Implements only.

Enumerates the physical devices accessible to a Vulkan instance

ยงFailures

On failure, this command returns

Source

fn iter_physical_devices(&self) -> Result<IterPhysicalDevices<'_, Self>>

Available on crate features Implements and alloc only.

Lazyly enumerates the physical devices accessible to a Vulkan instance

ยงFailures

On failure, this command returns

  • VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY
  • VK_ERROR_INITIALIZATION_FAILED
Source

fn enumerate_physical_devices_alloc( &self, ) -> Result<Vec<PhysicalDeviceObject<&Self>>>

Available on crate features Implements and alloc only.

Enumerates the physical devices accessible to a Vulkan instance

ยงFailures

On failure, this command returns

  • VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY
  • VK_ERROR_INITIALIZATION_FAILED

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<'s, T> Instance for &'s T
where T: Instance + ?Sized,

Sourceยง

impl<'s, T> Instance for &'s mut T
where T: Instance + ?Sized,

Sourceยง

impl<T> Instance for Box<T>
where T: Instance + ?Sized,

Sourceยง

impl<T> Instance for Rc<T>
where T: Instance + ?Sized,

Sourceยง

impl<T> Instance for Arc<T>
where T: Instance + ?Sized,

Sourceยง

impl<T> Instance for Ref<'_, T>
where T: Instance + ?Sized,

Sourceยง

impl<T> Instance for RefMut<'_, T>
where T: Instance + ?Sized,

Sourceยง

impl<T> Instance for ManuallyDrop<T>
where T: Instance,

Sourceยง

impl<T> Instance for MutexGuard<'_, T>
where T: Instance + ?Sized,

Sourceยง

impl<T> Instance for RwLockReadGuard<'_, T>
where T: Instance + ?Sized,

Sourceยง

impl<T> Instance for RwLockWriteGuard<'_, T>
where T: Instance + ?Sized,

Sourceยง

impl<T> Instance for MutexGuard<'_, T>
where T: Instance + ?Sized,

Sourceยง

impl<T> Instance for RwLockReadGuard<'_, T>
where T: Instance + ?Sized,

Sourceยง

impl<T> Instance for RwLockWriteGuard<'_, T>
where T: Instance + ?Sized,

Implementorsยง