pub trait Factory:
Sized
+ Clone
+ Send
+ 'static {
// Required method
fn definition() -> Self;
// Provided methods
fn traits() -> FactoryTraits<Self> { ... }
fn factory() -> FactoryBuilder<Self> { ... }
}Expand description
Trait for models that can be created via factories
Required Methods§
Sourcefn definition() -> Self
fn definition() -> Self
Define the default state of the model
Provided Methods§
Sourcefn traits() -> FactoryTraits<Self>
fn traits() -> FactoryTraits<Self>
Define named traits (states) for this factory
Sourcefn factory() -> FactoryBuilder<Self>
fn factory() -> FactoryBuilder<Self>
Create a factory builder for this model
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".