Skip to main content

Fixture

Trait Fixture 

Source
pub trait Fixture: Sized {
    type Output;

    // Required method
    fn build(self) -> Self::Output;

    // Provided method
    fn build_with<F>(self, f: F) -> Self::Output
       where F: FnOnce(&mut Self::Output) { ... }
}
Expand description

Fixture trait for test data builders

Required Associated Types§

Required Methods§

Source

fn build(self) -> Self::Output

Build the fixture

Provided Methods§

Source

fn build_with<F>(self, f: F) -> Self::Output
where F: FnOnce(&mut Self::Output),

Build with custom modifications

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.

Implementors§