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: Metadata) -> Self
pub fn new(metadata: Metadata) -> 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.
Panics
Panics if the runtime metadata version is not supported.
Supported versions: v14 and v15.
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 thesubxt
crate.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 thesubxt
crate.should_gen_docs
- True if the generated API contains the documentation from the metadata.
Auto Trait Implementations§
impl RefUnwindSafe for RuntimeGenerator
impl Send for RuntimeGenerator
impl Sync for RuntimeGenerator
impl Unpin for RuntimeGenerator
impl UnwindSafe for RuntimeGenerator
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more