pub trait Fixture: Sized {
// Required methods
fn set_up() -> Result<Self>;
fn tear_down(self) -> Result<()>;
}Expand description
Interface for structure to be set up and torn down as part of a test.
Types implementing Fixture can be passed as a reference argument to a
test function.
ⓘ
strct MyFixture { ... }
impl Fixture for MyFixture { ... }
#[gtest]
fn test_with_fixture(my_fixture: &MyFixture) {...}Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.