-
Notifications
You must be signed in to change notification settings - Fork 298
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
Provided Backend
trait Implementations - via features or separate crates?
#699
Comments
I think our multi-crate way at GFX works out pretty nice. Can't comment on the features approach, since I haven't used them much, but maybe @tomaka can share his experience. |
Is it possible to have a blanket impl for |
I have an idea: http://is.gd/p6MwOJ Implement When we get type macros, this pattern can be used with more complex backend traits. |
@bvssvni reminds me of our formats: impl Formatted for ($name, $channel) {
type Surface = $name;
type Channel = $channel;
type View = $container< <$channel as ChannelTyped>::ShaderType >;
} |
Ohhhh niccceee, this blanket impl for |
I've gone with the blanket impl in #696 and it seems like a much better solution than either of those I originally mentioned in this issue, as it doesn't require features or extra crates and still allows for users to impl |
@kvark Yeah, got the idea from Gfx. |
In #696 I'm adding a new
Backend
trait to consolidate the set of types and bounds necessary to run an instance of conrod.As the
piston_window
crate is used in our examples and will likely be most commonly used by users as a result, I'd like to provide an implementation of theBackend
trait forpiston_window
. It might also be nice to provide backends for other crates in the future also.I'm currently torn between two ways of doing this:
backend::piston_window
module behind a feature calledbackend-piston_window
.backends
directory with aconrod-piston_window
crate (within this repository).I'm currently leaning towards option 1. for a few reasons:
required-features
key for targets will make this very nice to use and give friendly errors when the necessary feature isn't enabled when trying to run examples.conrod-piston_window
.@bvssvni @kvark I'm interested to get your thoughts on this as both of you have experience with managing large multi-crate repos!
If anyone else has any thoughts on this feel free to add them 👍
The text was updated successfully, but these errors were encountered: