-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to choose backend at runtime #4
Comments
I guess that one first step for that to happen would be to exploit rust traits for the backends. Specifically Does that sound right @Boddlnagg ? |
I think there are two ways of doing this: I'm not sure which is better ... I think one disadvantage of (1) is that it requires boxing. I'm not sure of the performance impact, however, and aiming for an easy API might be the better goal. Maybe one should look at how other Rust libraries deal with dynamic backend selection (e.g. database abstractions, ...). |
Using traits (option (1)) might also not be feasible due to object safety rules. |
Another option might be https://crates.io/crates/trait-union |
E.g. compile with support for both ALSA and JACK, and give the application the ability to dynamically select the backend. It is not clear how this interacts with the
jack
feature-flag.The text was updated successfully, but these errors were encountered: