Function subxt_codegen::generate_runtime_api_from_path
source · pub fn generate_runtime_api_from_path<P>(
item_mod: ItemMod,
path: P,
derives: DerivesRegistry,
type_substitutes: TypeSubstitutes,
crate_path: CratePath,
should_gen_docs: bool,
runtime_types_only: bool
) -> Result<TokenStream2, CodegenError>where
P: AsRef<Path>,Expand description
Generates the API for interacting with a Substrate runtime.
Arguments
item_mod- The module declaration for which the API is implemented.path- The path to the scale encoded metadata of the runtime node.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.runtime_types_only- Whether to limit code generation to only runtime types.
Note: This is a wrapper over RuntimeGenerator for static metadata use-cases.