pub struct ModuleBuilder<'func> { /* private fields */ }
Expand description
Builds a new TestModule
The helper macro module!() is typically preferred over using this directly.
Implementations§
Source§impl<'func> ModuleBuilder<'func>
impl<'func> ModuleBuilder<'func>
pub fn new( package_name: &'static str, use_case: UseCase, module_path: &'static str, ) -> Self
Sourcepub fn build(self) -> TestModule
pub fn build(self) -> TestModule
Builds the TestModule
Creates the temp directory, if requested. Runs the setup function, if provided. Registers a shutdown hook to handle internal cleanup (temp directories) Register a shutdown hook for the custom teardown function, if provided
pub fn using_fixture_dir(self) -> Self
pub fn base_temp_dir<P>(self, dir: &P) -> Self
pub fn using_temp_dir(self) -> Self
pub fn skip_temp_dir_teardown(self, skip: bool) -> Self
pub fn setup(self, func: impl FnOnce(&mut TestModule) + 'func) -> Self
pub fn teardown_static(self, func: extern "C" fn()) -> Self
Auto Trait Implementations§
impl<'func> Freeze for ModuleBuilder<'func>
impl<'func> !RefUnwindSafe for ModuleBuilder<'func>
impl<'func> !Send for ModuleBuilder<'func>
impl<'func> !Sync for ModuleBuilder<'func>
impl<'func> Unpin for ModuleBuilder<'func>
impl<'func> !UnwindSafe for ModuleBuilder<'func>
Blanket Implementations§
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