Skip to main content

ModuleGen

Trait ModuleGen 

Source
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§

Source

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> { .. }.

Source

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".

Implementations on Foreign Types§

Source§

impl ModuleGen for Module

Source§

fn to_rust( &self, thecrate: &TokenStream, package: Option<&LiteralString>, address_map: &HashMap<Ident, TokenStream>, ) -> Result<TokenStream, Box<dyn Error + 'static>>

Source§

fn to_parts( &self, thecrate: &TokenStream, package: Option<&LiteralString>, address_map: &HashMap<Ident, TokenStream>, ) -> Result<ModuleParts, Box<dyn Error + 'static>>

Implementors§