15
A Failed Experiment With Static Dispatch
(jmmv.dev)
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Credits
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
tostruct DriverImpl
, define atrait Driver
and for the implementation you'd useimpl Driver for DriverImpl where etc...