Skip to main content

Instance

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 [MaybeUninit<VkPhysicalDevice>],
    ) -> Result<ArrayQueryResult<u32>> { ... }
    fn iter_physical_devices<'a>(
        &'a self,
    ) -> Result<IterPhysicalDevices<'a, 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!)

Return a function pointer for a command

Source

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

Counts the physical devices accessible to a Vulkan instance

ยงFailures

On failure, this command returns

Source

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

Enumerates the physical devices accessible to a Vulkan instance

ยงFailures

On failure, this command returns

Source

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

Lazyly enumerates the physical devices accessible to a Vulkan instance

ยงFailures

On failure, this command returns

  • brvk::VK_ERROR_OUT_OF_HOST_MEMORY
  • brvk::VK_ERROR_OUT_OF_DEVICE_MEMORY
  • brvk::VK_ERROR_INITIALIZATION_FAILED
Source

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

Enumerates the physical devices accessible to a Vulkan instance

ยงFailures

On failure, this command returns

  • brvk::VK_ERROR_OUT_OF_HOST_MEMORY
  • brvk::VK_ERROR_OUT_OF_DEVICE_MEMORY
  • brvk::VK_ERROR_INITIALIZATION_FAILED

Dyn Compatibilityยง

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

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 Arc<T>
where T: Instance + ?Sized,

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

impl<T> Instance for Rc<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 RwLockReadGuard<'_, 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 RwLockWriteGuard<'_, T>
where T: Instance + ?Sized,

Implementorsยง