Module :: mod_interface
Protocol of modularity unifying interface of a module and introducing layers.
Basic use-case
Library file with code inner.rs
:
pub
//
mod_interface!
Main file that generates modules and namespaces main.rs
:
use mod_interface;
//
//
mod_interface!
It generates code :
use mod_interface;
//
//
/// Inner.
/// Protected namespace of the module.
pub use *;
/// Orphan namespace of the module.
/// Exposed namespace of the module.
/// Prelude to use essentials: `use my_module::prelude::*`.
Debugging
To debug module interface use directive #![ debug ]
in macro mod_interface
. Let's update the main file of the example :
!
mod_interface
Full sample see at sample directory.
To add to your project
Try out from the repository