Skip to content

Glossary: Software Design Patterns in Rust

Adapter

Also written: adapters

A wrapper that holds a library value with an awkward shape and implements your trait, translating each call. Kettle & Crane's UpsCarrier adapts UpsApi, which wants line counts and answers in cents.

Where the book teaches it

Related terms

WrapperDecorator