On 07/05/2012 06:00 PM, Jesse Jones wrote:
I didn't mean to do a private reply: my email client does that by default and I
don't always remember to fix the reply address.
As far as my problem goes I think it's something you guys have a handle on. But
to be clear, what I want to do is write a library with a public API yet have
the freedom to physically structure the library however I want. So I want
clients to be able to pull in the public API with a single import even if the
items were defined in different modules. And this did not work: clients of my
library had to use multiple imports.
Here is the actual library code where I re-export the public API:
https://github.com/jesse99/rrdf/blob/master/src/rrdf.rs. The thought was that
clients could then do `import rrdf::*;` but what they have to do instead is
crap like:
import rrdf::object::*;
import rrdf::store::*;
That's surprising. Perhaps it's a problem specifically relating to
cross-crate reexporting.
Regardless, this kind of thing is still somewhat of a black art,
sometimes involving fighting the whims of the broken resolve pass, but
it should be possible.
In the future you will probably be able to reexport an entire module
interface in a single line, something vaguely like:
export foo::*;
export bar::*;
mod foo { ... }
mod bar { ... }
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev