pub trait ModuleGen: Sealed {
// Required methods
fn to_rust(
&self,
thecrate: &TokenStream,
package: Option<&LiteralString>,
address_map: &HashMap<Ident, TokenStream>,
) -> Result<TokenStream, Box<dyn Error + 'static>>;
fn to_parts(
&self,
thecrate: &TokenStream,
package: Option<&LiteralString>,
address_map: &HashMap<Ident, TokenStream>,
) -> Result<ModuleParts, Box<dyn Error + 'static>>;
}Required Methods§
Sourcefn to_rust(
&self,
thecrate: &TokenStream,
package: Option<&LiteralString>,
address_map: &HashMap<Ident, TokenStream>,
) -> Result<TokenStream, Box<dyn Error + 'static>>
fn to_rust( &self, thecrate: &TokenStream, package: Option<&LiteralString>, address_map: &HashMap<Ident, TokenStream>, ) -> Result<TokenStream, Box<dyn Error + 'static>>
Generate the module’s datatypes as a standalone pub mod <ident> { .. }.
Sourcefn to_parts(
&self,
thecrate: &TokenStream,
package: Option<&LiteralString>,
address_map: &HashMap<Ident, TokenStream>,
) -> Result<ModuleParts, Box<dyn Error + 'static>>
fn to_parts( &self, thecrate: &TokenStream, package: Option<&LiteralString>, address_map: &HashMap<Ident, TokenStream>, ) -> Result<ModuleParts, Box<dyn Error + 'static>>
Generate the module’s datatypes as placeable ModuleParts, so a caller can weave the
body into a mod of its own construction (e.g. alongside other generated items for the
same Move module).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".