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§
Sourcetype TestLayerType: Layer
type TestLayerType: Layer
Required Methods§
Sourcefn instance() -> &'static Global<Self::TestLayerType>
fn instance() -> &'static Global<Self::TestLayerType>
Used to mock Layer::global_instance.
Sourcefn mock() -> &'static Self
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.
Sourcefn manifest(&self) -> LayerManifest
fn manifest(&self) -> LayerManifest
Used to mock Layer::manifest.
Sourcefn hooked_global_commands(&self) -> &[LayerVulkanCommand]
fn hooked_global_commands(&self) -> &[LayerVulkanCommand]
Used to mock GlobalHooksInfo::hooked_commands.
Sourcefn hooked_instance_commands(&self) -> &[LayerVulkanCommand]
fn hooked_instance_commands(&self) -> &[LayerVulkanCommand]
Used to mock InstanceInfo::hooked_commands.
Sourcefn hooked_device_commands(&self) -> &[LayerVulkanCommand]
fn hooked_device_commands(&self) -> &[LayerVulkanCommand]
Used to mock DeviceInfo::hooked_commands.
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.