Struct MockDeviceInfo

Source
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>

Source

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>

Source§

fn default() -> MockDeviceInfo<T>

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

impl<T: TestLayerMock> DeviceInfo for MockDeviceInfo<T>

Source§

type HooksType = MockDeviceHooks

The underlying DeviceHooks type that implements the core logic to intercept Vulkan device functions. Read more
Source§

type HooksRefType<'a> = MutexGuard<'a, MockDeviceHooks>

A type that can be dereferencing to DeviceInfo::HooksType. Usually just &DeviceInfo::HooksType. Read more
Source§

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<'_>

Returns the reference of the DeviceInfo::HooksType. Read more

Auto 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§

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 + Sync + Send>

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.