Skip to main content

Factory

Trait Factory 

Source
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§

Source

fn definition() -> Self

Define the default state of the model

Provided Methods§

Source

fn traits() -> FactoryTraits<Self>

Define named traits (states) for this factory

Source

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", so this trait is not object safe.

Implementors§