Skip to content

Chapter 5 — Traits & Generics ​

Auto's word for trait is spec. Declare it, implement it on types with type T as Spec { ... }, and dispatch through a spec-typed parameter — a2r emits Rust trait / impl / Box<dyn>.

Dev→Ship
Auto source
Rust (a2r output)
Click "Transpile to Rust" to see the transpiled code.
VM output
No output yet
A spec with two implementations, dispatched dynamically

Released under the MIT License.