Closed ids1024 closed 9 months ago
I see some tests are failing since an indirect dev-dependency requires Rust 1.70... not sure what we want to do there.
Though that's unrelated to this change.
The alternative to the macro would be Box<dyn ...>
, but that's probably not possible anyway with the associated type.
I think the enum_dispatch
crate would be a popular solution here, but that adds a proc macro dependency.
I see some tests are failing since an indirect dev-dependency requires Rust 1.70... not sure what we want to do there.
Rebase on master for fixed MSRV CI
Added fixes for (unrelated) CI issues, and moved the backends to a backends
module.
Added a commit that move the backend context/surface ::new
methods into traits, making it possible for make_dispatch!
to handle new
like it handles other methods.
This still uses enums to dispatch to the backends, but has the
*Dispatch
types implement the same traits. Nothing about the behavior or performance should change.If we require backends to implement the same methods, it seems good to use traits for that. Any documentation on the interface implemented by backends can be in one place. The traits can provide default implementations where appropriate.
Hopefully this will help with more refactoring and features.