From b0264f33e991ddf1c0f59c9ecb8e448f3687d076 Mon Sep 17 00:00:00 2001 From: Inkvisto Date: Thu, 18 Jul 2024 12:57:34 +0300 Subject: [PATCH] ref: Readme for mod_interface --- module/core/mod_interface/Readme.md | 26 ++++++++++------------- module/core/mod_interface_meta/src/lib.rs | 2 +- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/module/core/mod_interface/Readme.md b/module/core/mod_interface/Readme.md index fcb4643b8f..2b191d8bf0 100644 --- a/module/core/mod_interface/Readme.md +++ b/module/core/mod_interface/Readme.md @@ -72,30 +72,35 @@ pub mod inner /// Routine of inner module. pub fn inner_is() -> bool { true } } - + + pub use own::*; + /// Own namespace of the module. pub mod own { + use super::*; pub use orphan::*; } - pub use own::*; /// Orphan namespace of the module. pub mod orphan { + use super::*; pub use exposed::*; } /// Exposed namespace of the module. pub mod exposed { + use super::*; pub use prelude::*; } /// Prelude to use essentials: `use my_module::prelude::*`. pub mod prelude { - pub use private::inner_is; + use super::*; + pub use super::private::inner_is; } } @@ -105,7 +110,7 @@ pub mod own { use super::*; pub use orphan::*; - pub use super::inner::orphan::*; + pub use inner::orphan::*; } pub use own::*; @@ -123,7 +128,7 @@ pub mod exposed { use super::*; pub use prelude::*; - pub use super::inner::exposed::*; + pub use inner::exposed::*; } /// Prelude to use essentials: `use my_module::prelude::*`. @@ -131,7 +136,7 @@ pub mod exposed pub mod prelude { use super::*; - pub use super::inner::prelude::*; + pub use inner::prelude::*; } ``` @@ -155,15 +160,6 @@ Full sample see at [sample directory](https://github.com/Wandalen/wTools/tree/ma ```sh cargo add mod_interface ``` - -### Try out from the repository - -```sh -git clone https://github.com/Wandalen/wTools -cd wTools -cd examples/mod_interface_trivial -cargo run -``` ### Try out from the repository ```sh diff --git a/module/core/mod_interface_meta/src/lib.rs b/module/core/mod_interface_meta/src/lib.rs index bb595ba9a2..664abd59cb 100644 --- a/module/core/mod_interface_meta/src/lib.rs +++ b/module/core/mod_interface_meta/src/lib.rs @@ -119,7 +119,7 @@ mod_interface! } - private < protected < orphan < exposed < prelude + private < own < orphan < exposed < prelude itself itself its parent its inter-module its inter-module private public public public public