Skip to content

Glossary: Software Design Patterns in Rust

Simple factory

One function that knows every type and turns a name into the right value, such as create_carrier("ups"). A new carrier is a struct, an impl and a match arm.

Where the book teaches it

Related terms

FactoryFactory method