Struct subxt_codegen::RuntimeGenerator
source · pub struct RuntimeGenerator { /* private fields */ }Expand description
Create the API for interacting with a Substrate runtime.
Implementations§
source§impl RuntimeGenerator
impl RuntimeGenerator
sourcepub fn new(metadata: RuntimeMetadataPrefixed) -> Self
pub fn new(metadata: RuntimeMetadataPrefixed) -> Self
Create a new runtime generator from the provided metadata.
Note: If you have the metadata path, URL or bytes to hand, prefer to use
one of the generate_runtime_api_from_* functions for generating the runtime API
from that.
sourcepub fn generate_runtime_types(
&self,
item_mod: ItemMod,
derives: DerivesRegistry,
type_substitutes: TypeSubstitutes,
crate_path: CratePath,
should_gen_docs: bool
) -> Result<TokenStream2, CodegenError>
pub fn generate_runtime_types( &self, item_mod: ItemMod, derives: DerivesRegistry, type_substitutes: TypeSubstitutes, crate_path: CratePath, should_gen_docs: bool ) -> Result<TokenStream2, CodegenError>
Generate the API for interacting with a Substrate runtime.
Arguments
item_mod- The module declaration for which the API is implemented.derives- Provide custom derives for the generated types.type_substitutes- Provide custom type substitutes.crate_path- Path to thesubxtcrate.should_gen_docs- True if the generated API contains the documentation from the metadata.
sourcepub fn generate_runtime(
&self,
item_mod: ItemMod,
derives: DerivesRegistry,
type_substitutes: TypeSubstitutes,
crate_path: CratePath,
should_gen_docs: bool
) -> Result<TokenStream2, CodegenError>
pub fn generate_runtime( &self, item_mod: ItemMod, derives: DerivesRegistry, type_substitutes: TypeSubstitutes, crate_path: CratePath, should_gen_docs: bool ) -> Result<TokenStream2, CodegenError>
Generate the API for interacting with a Substrate runtime.
Arguments
item_mod- The module declaration for which the API is implemented.derives- Provide custom derives for the generated types.type_substitutes- Provide custom type substitutes.crate_path- Path to thesubxtcrate.should_gen_docs- True if the generated API contains the documentation from the metadata.