diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index e65dc261958f4..523b0d72ca712 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -25,5 +25,9 @@ pub use self::{ generate_runtime_api, RuntimeGenerator, }, - types::GeneratedTypeDerives, + types::{ + GeneratedTypeDerives, + Module, + TypeGenerator, + }, }; diff --git a/codegen/src/types/mod.rs b/codegen/src/types/mod.rs index b6972bdc7ff27..c29dbd341293e 100644 --- a/codegen/src/types/mod.rs +++ b/codegen/src/types/mod.rs @@ -221,6 +221,7 @@ impl<'a> TypeGenerator<'a> { } } +/// Represents a Rust `mod`, containing generated types and child `mod`s. #[derive(Debug)] pub struct Module<'a> { name: Ident, @@ -248,7 +249,8 @@ impl<'a> ToTokens for Module<'a> { } impl<'a> Module<'a> { - pub fn new(name: Ident, root_mod: Ident) -> Self { + /// Create a new [`Module`], with a reference to the root `mod` for resolving type paths. + pub(crate) fn new(name: Ident, root_mod: Ident) -> Self { Self { name, root_mod,