Trait TestLayerMock

Source
pub trait TestLayerMock: 'static {
    type TestLayerType: Layer;

    // Required methods
    fn instance() -> &'static Global<Self::TestLayerType>;
    fn mock() -> &'static Self;
    fn manifest(&self) -> LayerManifest;
    fn hooked_global_commands(&self) -> &[LayerVulkanCommand];
    fn hooked_instance_commands(&self) -> &[LayerVulkanCommand];
    fn hooked_device_commands(&self) -> &[LayerVulkanCommand];
}
Available on crate feature _test only.
Expand description

A set of interfaces that the integration tests are interested to mock.

Required Associated Types§

Source

type TestLayerType: Layer

The associated type that implements the Layer trait. Should be a specialized TestLayer.

Required Methods§

Source

fn instance() -> &'static Global<Self::TestLayerType>

Used to mock Layer::global_instance.

Source

fn mock() -> &'static Self

Used to obtain the singleton of this object.

This interface is used to obtain the mock object in the static methods like DeviceInfo::hooked_commands. The mock object can’t be part of Global, because we want to allow the mocked interfaces to be called during or before the initialization of Global.

Source

fn manifest(&self) -> LayerManifest

Used to mock Layer::manifest.

Source

fn hooked_global_commands(&self) -> &[LayerVulkanCommand]

Source

fn hooked_instance_commands(&self) -> &[LayerVulkanCommand]

Source

fn hooked_device_commands(&self) -> &[LayerVulkanCommand]

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.

Implementors§