pub struct MockDeviceInfo<T: TestLayerMock> {
pub mock_hooks: Mutex<MockDeviceHooks>,
/* private fields */
}Available on crate feature
_test only.Expand description
A mock struct that implements the DeviceInfo trait.
The T type parameter is a TestLayerMock type that provides the mock of
DeviceInfo::hooked_commands.
Fields§
§mock_hooks: Mutex<MockDeviceHooks>The mock of the DeviceHooks.
Implementations§
Source§impl<T: TestLayerMock> MockDeviceInfo<T>
impl<T: TestLayerMock> MockDeviceInfo<T>
Sourcepub fn with_mock_drop(&self, f: impl FnOnce(&mut MockDrop))
pub fn with_mock_drop(&self, f: impl FnOnce(&mut MockDrop))
Mock the drop behavior.
The expectations can be set through the f argument. If this method is never called, the
struct will be dropped as if the drop is not mocked, i.e. won’t check how drop is called.
Trait Implementations§
Source§impl<T: Default + TestLayerMock> Default for MockDeviceInfo<T>
impl<T: Default + TestLayerMock> Default for MockDeviceInfo<T>
Source§fn default() -> MockDeviceInfo<T>
fn default() -> MockDeviceInfo<T>
Returns the “default value” for a type. Read more
Source§impl<T: TestLayerMock> DeviceInfo for MockDeviceInfo<T>
impl<T: TestLayerMock> DeviceInfo for MockDeviceInfo<T>
Source§type HooksType = MockDeviceHooks
type HooksType = MockDeviceHooks
The underlying
DeviceHooks type that implements the core logic to intercept
Vulkan device functions. Read moreSource§type HooksRefType<'a> = MutexGuard<'a, MockDeviceHooks>
type HooksRefType<'a> = MutexGuard<'a, MockDeviceHooks>
A type that can be dereferencing to
DeviceInfo::HooksType. Usually just
&DeviceInfo::HooksType. Read moreSource§fn hooked_commands() -> &'static [LayerVulkanCommand]
fn hooked_commands() -> &'static [LayerVulkanCommand]
Returns a slice of
Vulkan device functions
that the layer implementation needs to intercept. Read more
Source§fn hooks(&self) -> Self::HooksRefType<'_>
fn hooks(&self) -> Self::HooksRefType<'_>
Returns the reference of the
DeviceInfo::HooksType. Read moreAuto Trait Implementations§
impl<T> !Freeze for MockDeviceInfo<T>
impl<T> RefUnwindSafe for MockDeviceInfo<T>
impl<T> Send for MockDeviceInfo<T>
impl<T> Sync for MockDeviceInfo<T>
impl<T> Unpin for MockDeviceInfo<T>
impl<T> UnwindSafe for MockDeviceInfo<T>
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more