pub struct TestGlobalBuilder<T: TestLayerTag = Tag<0>> { /* private fields */ }Available on crate feature
_test only.Expand description
The builder for TestGlobal.
Implementations§
Source§impl<T: TestLayerTag> TestGlobalBuilder<T>
impl<T: TestLayerTag> TestGlobalBuilder<T>
Sourcepub const fn set_layer_mock_builder(
self,
layer_mock_builder: fn() -> MockTestLayer<T>,
) -> Self
pub const fn set_layer_mock_builder( self, layer_mock_builder: fn() -> MockTestLayer<T>, ) -> Self
Specify how MockTestLayer should be created.
Can be used to customize the behavior of pre-initialized methods, like
InstanceInfo::hooked_commands.
Pre-initialized methods are almost always called, so it is usually needed to call
MockTestLayer::set_default_expectations right before return to provide a meaningful
default behavior.
Sourcepub const fn set_layer_global_builder(
self,
layer_global_builder: fn() -> Global<TestLayer<T>>,
) -> Self
pub const fn set_layer_global_builder( self, layer_global_builder: fn() -> Global<TestLayer<T>>, ) -> Self
Specify how Global<TestLayer<T>> should be created.
Can be used to customize the behavior and expectations of layer behaviors after Global
is initialized, especially the global commands, e.g.
GlobalHooks::create_instance.
Sourcepub const fn build(&self) -> TestGlobal<T>
pub const fn build(&self) -> TestGlobal<T>
Construct the TestGlobal<T>.
This is a const function, and can be directly used to initialize a static variable.
Auto Trait Implementations§
impl<T> Freeze for TestGlobalBuilder<T>
impl<T> RefUnwindSafe for TestGlobalBuilder<T>
impl<T> Send for TestGlobalBuilder<T>
impl<T> Sync for TestGlobalBuilder<T>
impl<T> Unpin for TestGlobalBuilder<T>
impl<T> UnwindSafe for TestGlobalBuilder<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