Rust programming language

Re-exporting

As documented here If you’ve built a sub-module and you want to make functions or structures available at a level above, you can re-export:

// `sub_module1` and `sub_module2` are not visible outside.
mod sub_module1 {
    pub struct Foo;
}
mod sub_module2 {
    pub struct AnotherFoo;
}
// We re-export both types:
pub use crate::sub_module1::Foo;
pub use crate::sub_module2::AnotherFoo;