15
A Failed Experiment With Static Dispatch
(jmmv.dev)
Unless I'm missing something, I think you can clean it up and keep your static dispatch by turning the Driver struct into a trait:
You'd rename your struct Driver
to struct DriverImpl
, define a trait Driver
and for the implementation you'd use impl Driver for DriverImpl where etc...
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Credits