graydon/rust — Issue #1238: (export foo::*) re-export all contents of module
Author: DylanLukes
Created: 2011-12-01 05:27:56+00:00
State: open

I would like to request a simple addition to the export syntax, which reexports everything in a module from the current module.

For example, you might be in a file foo.rs, and want to define some types and export some native functions. You might do:

```rust
use std;

export a, b;
export foo_internal::*;

type a = int;
type b = std::str;

native mod foo_internal {
< some native functions >
}

```

In this manner you can embed a native module in another. Of course this isn't limited to native modules, but it's especially relevant since the implicit module of a file can't be native.