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.
Trait Implementations§
source§impl Decode for Metadata
impl Decode for Metadata
source§fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
source§impl Encode for Metadata
impl Encode for Metadata
source§fn encode_to<T: Output + ?Sized>(&self, dest: &mut T)
fn encode_to<T: Output + ?Sized>(&self, dest: &mut T)
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl ExtrinsicTypeInfo for Metadata
impl ExtrinsicTypeInfo for Metadata
source§fn get_call_info(
&self,
pallet_index: u8,
call_index: u8,
) -> Result<ExtrinsicCallInfo<'_, Self::TypeId>, ExtrinsicInfoError<'_>>
fn get_call_info( &self, pallet_index: u8, call_index: u8, ) -> Result<ExtrinsicCallInfo<'_, Self::TypeId>, ExtrinsicInfoError<'_>>
source§fn get_signature_info(
&self,
) -> Result<ExtrinsicSignatureInfo<Self::TypeId>, ExtrinsicInfoError<'_>>
fn get_signature_info( &self, ) -> Result<ExtrinsicSignatureInfo<Self::TypeId>, ExtrinsicInfoError<'_>>
source§fn get_extension_info(
&self,
extension_version: Option<u8>,
) -> Result<ExtrinsicExtensionInfo<'_, Self::TypeId>, ExtrinsicInfoError<'_>>
fn get_extension_info( &self, extension_version: Option<u8>, ) -> Result<ExtrinsicExtensionInfo<'_, Self::TypeId>, ExtrinsicInfoError<'_>>
source§impl From<Metadata> for RuntimeMetadataPrefixed
impl From<Metadata> for RuntimeMetadataPrefixed
source§impl From<Metadata> for RuntimeMetadataV14
impl From<Metadata> for RuntimeMetadataV14
source§impl From<Metadata> for RuntimeMetadataV15
impl From<Metadata> for RuntimeMetadataV15
source§impl TryFrom<RuntimeMetadataPrefixed> for Metadata
impl TryFrom<RuntimeMetadataPrefixed> for Metadata
source§type Error = TryFromError
type Error = TryFromError
source§impl TryFrom<RuntimeMetadataV14> for Metadata
impl TryFrom<RuntimeMetadataV14> for Metadata
source§type Error = TryFromError
type Error = TryFromError
source§impl TryFrom<RuntimeMetadataV15> for Metadata
impl TryFrom<RuntimeMetadataV15> for Metadata
source§type Error = TryFromError
type Error = TryFromError
source§fn try_from(m: RuntimeMetadataV15) -> Result<Self, TryFromError>
fn try_from(m: RuntimeMetadataV15) -> Result<Self, TryFromError>
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)