Short answer: use pub use Typeat mod.rs. The following is a complete example:
My structure:
/src/main.rs
/src/protocol/
/src/protocol/mod.rs
/src/protocol/thing.rs
main.rs
mod protocol;
fn main() {
let a = protocol::Thing::new();
println!("Hello, {:?}", a);
}
protocol /mod.rs
pub use self::thing::Thing;
mod thing;
Protocol /thing.rs
#[derive(Show)]
pub struct Thing(i8);
impl Thing {
pub fn new() -> Thing { Thing(4) }
}
, , . struct , . , , ^ _ ^.
, : , - , . , , .