Struct TestLayer

Source
pub struct TestLayer<T: TestLayerTag = Tag<0>> { /* private fields */ }
Available on crate feature _test only.
Expand description

The mock for the Layer trait.

Different T will result in different types, default to Tag<0>. TestGlobal<T> contains the static resources(e.g. Global<TestLayer<T>>) related to this mock layer.

Implementations§

Source§

impl<T: TestLayerTag> TestLayer<T>

Source

pub fn get_instance_info( &self, instance: Instance, ) -> Option<Arc<impl Deref<Target = <Self as Layer>::InstanceInfo>>>

Get the InstanceInfo mock from a VkInstance.

Source

pub fn get_device_info( &self, device: Device, ) -> Option<Arc<impl Deref<Target = <Self as Layer>::DeviceInfo>>>

Get the DeviceInfo mock from a VkDevice.

Trait Implementations§

Source§

impl<T: TestLayerTag> Default for TestLayer<T>

Source§

fn default() -> Self

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

impl<T: TestLayerTag> Layer for TestLayer<T>

Source§

type GlobalHooksInfo = MockGlobalHooksInfo<MockTestLayer<T>>

The type that provides information about interception of global commands. Read more
Source§

type InstanceInfo = MockInstanceInfo<MockTestLayer<T>>

The type that provides information about interception of Vulkan instance functions, global commands not included. Read more
Source§

type DeviceInfo = MockDeviceInfo<MockTestLayer<T>>

The type that provides information about interception of Vulkan device functions. Read more
Source§

type InstanceInfoContainer = ArcDel<<TestLayer<T> as Layer>::InstanceInfo>

The type that holds a Layer::InstanceInfo type. Usually just Self::InstanceInfo. Read more
Source§

type DeviceInfoContainer = ArcDel<<TestLayer<T> as Layer>::DeviceInfo>

The type that holds a Layer::DeviceInfo type. Usually just Self::DeviceInfo. Read more
Source§

fn global_instance() -> impl Deref<Target = Global<Self>> + 'static

Provide the reference to the global singleton of Global. Read more
Source§

fn manifest() -> LayerManifest

Returns the layer manifest to the layer framework. Read more
Source§

fn global_hooks_info(&self) -> &Self::GlobalHooksInfo

Returns a reference of the underlying GlobalHooksInfo object.
Source§

fn create_device_info( &self, _physical_device: PhysicalDevice, _create_info: &DeviceCreateInfo, _allocator: Option<&AllocationCallbacks>, device: Arc<Device>, _next_get_device_proc_addr: PFN_vkGetDeviceProcAddr, ) -> ArcDel<Self::DeviceInfo>

The factory method for the DeviceInfo type. Read more
Source§

fn create_instance_info( &self, _create_info: &InstanceCreateInfo, _allocator: Option<&AllocationCallbacks>, instance: Arc<Instance>, _next_get_instance_proc_addr: PFN_vkGetInstanceProcAddr, ) -> ArcDel<Self::InstanceInfo>

The factory method for the InstanceInfo type. Read more
Source§

fn global_hooks( &self, ) -> <Self::GlobalHooksInfo as GlobalHooksInfo>::HooksRefType<'_>

Returns a reference of the underlying GlobalHooks object. Read more
Source§

fn hooked_instance_commands( &self, _instance_info: &Self::InstanceInfo, ) -> Box<dyn Iterator<Item = VulkanCommand>>

Returns an iterator of Vulkan instance functions (global commands not included) that the layer implementation needs to intercept. Read more
Source§

fn hooked_device_commands( &self, _instance_info: &Self::InstanceInfo, _device_info: Option<&Self::DeviceInfo>, ) -> Box<dyn Iterator<Item = VulkanCommand>>

Returns an iterator of Vulkan device functions that the layer implementation needs to intercept. Read more

Auto Trait Implementations§

§

impl<T = Tag<0>> !Freeze for TestLayer<T>

§

impl<T> RefUnwindSafe for TestLayer<T>

§

impl<T> Send for TestLayer<T>

§

impl<T> Sync for TestLayer<T>

§

impl<T> Unpin for TestLayer<T>

§

impl<T> UnwindSafe for TestLayer<T>

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
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.