Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRe-export FooMethods and FooCast from DOM module foo #3576
Comments
|
I'm new to Rust and Servo, but I'm interesting in diving into the language and figured servo was a great place to start. This task seemed simple enough. After some googling on what exactly |
|
It's yours! |
|
@ctlevi Hi, I'm wondering if you're still working on this? Otherwise I would like to take it. |
|
@Manishearth actually has a syntax extension that should be able to accomplish this automatically after the next Rust upgrade, so I don't think it's worth investing the time to do this manually any more. |
|
Yeah, I have one. https://github.com/Manishearth/servo/compare/reexport , but it doesn't work yet because rustup ( |
|
Not all interfaces have a method trait. |
|
We could codegen a module that contains the cast, the constants module and the method trait, and then use * in that from a plugin. |
Instead of making other DOM code import
dom::bindings::codegen::Bindings::FooBinding::FooMethodsin order to call methods onJSRef<Foo>, we should just re-export (ie.pub use) the FooMethods and FooCast traits for each type in its DOM implementation module. Then users can douse dom::foo::{Foo, FooMethods, FooCast}and it will be much more readable.