pub struct Metadata { /* private fields */ }Expand description
Node metadata. This can be constructed by providing some compatible frame_metadata
which is then decoded into this. We aim to preserve all of the existing information in
the incoming metadata while optimizing the format a little for Subxt’s use cases.
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn types(&self) -> &PortableRegistry
pub fn types(&self) -> &PortableRegistry
Access the underlying type registry.
Sourcepub fn types_mut(&mut self) -> &mut PortableRegistry
pub fn types_mut(&mut self) -> &mut PortableRegistry
Mutable access to the underlying type registry.
Sourcepub fn runtime_ty(&self) -> u32
pub fn runtime_ty(&self) -> u32
The type ID of the Runtime type.
Sourcepub fn dispatch_error_ty(&self) -> Option<u32>
pub fn dispatch_error_ty(&self) -> Option<u32>
The type ID of the DispatchError type, if it exists.
Sourcepub fn extrinsic(&self) -> &ExtrinsicMetadata
pub fn extrinsic(&self) -> &ExtrinsicMetadata
Return details about the extrinsic format.
Sourcepub fn outer_enums(&self) -> OuterEnumsMetadata
pub fn outer_enums(&self) -> OuterEnumsMetadata
Return details about the outer enums.
Sourcepub fn pallets(&self) -> impl ExactSizeIterator<Item = PalletMetadata<'_>>
pub fn pallets(&self) -> impl ExactSizeIterator<Item = PalletMetadata<'_>>
An iterator over all of the available pallets.
Sourcepub fn pallet_by_index(&self, variant_index: u8) -> Option<PalletMetadata<'_>>
pub fn pallet_by_index(&self, variant_index: u8) -> Option<PalletMetadata<'_>>
Access a pallet given its encoded variant index.
Sourcepub fn pallet_by_name(&self, pallet_name: &str) -> Option<PalletMetadata<'_>>
pub fn pallet_by_name(&self, pallet_name: &str) -> Option<PalletMetadata<'_>>
Access a pallet given its name.
Sourcepub fn runtime_api_traits(
&self,
) -> impl ExactSizeIterator<Item = RuntimeApiMetadata<'_>>
pub fn runtime_api_traits( &self, ) -> impl ExactSizeIterator<Item = RuntimeApiMetadata<'_>>
An iterator over all of the runtime APIs.
Sourcepub fn runtime_api_trait_by_name(
&self,
name: &str,
) -> Option<RuntimeApiMetadata<'_>>
pub fn runtime_api_trait_by_name( &self, name: &str, ) -> Option<RuntimeApiMetadata<'_>>
Access a runtime API trait given its name.
Sourcepub fn custom(&self) -> CustomMetadata<'_>
pub fn custom(&self) -> CustomMetadata<'_>
Returns custom user defined types
Sourcepub fn hasher(&self) -> MetadataHasher<'_>
pub fn hasher(&self) -> MetadataHasher<'_>
Obtain a unique hash representing this metadata or specific parts of it.
Sourcepub fn retain<F, G>(&mut self, pallet_filter: F, api_filter: G)
pub fn retain<F, G>(&mut self, pallet_filter: F, api_filter: G)
Filter out any pallets and/or runtime_apis that we don’t want to keep, retaining only those that we do.
Note:
only filter by pallets will not lead to significant metadata size reduction because the return types are kept to ensure that those can be decoded.