pub struct MockInstanceInfo<T: TestLayerMock> {
pub mock_hooks: Mutex<MockInstanceHooks>,
/* private fields */
}Available on crate feature
_test only.Expand description
A mock struct that implements the InstanceInfo trait.
The T type parameter is a TestLayerMock type that provides the mock of
InstanceInfo::hooked_commands.
Fields§
§mock_hooks: Mutex<MockInstanceHooks>The mock of the InstanceHooks.
Implementations§
Source§impl<T: TestLayerMock> MockInstanceInfo<T>
impl<T: TestLayerMock> MockInstanceInfo<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 MockInstanceInfo<T>
impl<T: Default + TestLayerMock> Default for MockInstanceInfo<T>
Source§fn default() -> MockInstanceInfo<T>
fn default() -> MockInstanceInfo<T>
Returns the “default value” for a type. Read more
Source§impl<T: TestLayerMock> InstanceInfo for MockInstanceInfo<T>
impl<T: TestLayerMock> InstanceInfo for MockInstanceInfo<T>
Source§type HooksType = MockInstanceHooks
type HooksType = MockInstanceHooks
The underlying
InstanceHooks type that implements the core logic to intercept
Vulkan instance functions
apart from
global commands. Read moreSource§type HooksRefType<'a> = MutexGuard<'a, MockInstanceHooks>
type HooksRefType<'a> = MutexGuard<'a, MockInstanceHooks>
A type that can be dereferencing to
InstanceInfo::HooksType. Usually
&InstanceInfo::HooksType. Read moreSource§fn hooked_commands() -> &'static [LayerVulkanCommand]
fn hooked_commands() -> &'static [LayerVulkanCommand]
Returns a slice of
Vulkan instance functions
(global commands
not included) 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
InstanceInfo::HooksType. Read moreAuto Trait Implementations§
impl<T> !Freeze for MockInstanceInfo<T>
impl<T> RefUnwindSafe for MockInstanceInfo<T>
impl<T> Send for MockInstanceInfo<T>
impl<T> Sync for MockInstanceInfo<T>
impl<T> Unpin for MockInstanceInfo<T>
impl<T> UnwindSafe for MockInstanceInfo<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