Skip to content

Commit

Permalink
Export codegen::TypeGenerator (paritytech#444)
Browse files Browse the repository at this point in the history
* Export codegen::TypeGenerator

* Export Module and add comments to public methods

* Fmt
  • Loading branch information
ascjones committed Feb 12, 2022
1 parent 4bed7eb commit 7615b25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ pub use self::{
generate_runtime_api,
RuntimeGenerator,
},
types::GeneratedTypeDerives,
types::{
GeneratedTypeDerives,
Module,
TypeGenerator,
},
};
4 changes: 3 additions & 1 deletion codegen/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 7615b25

Please sign in to comment.