Struct subxt_metadata::Metadata
source · 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 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 hasher(&self) -> MetadataHasher<'_>
pub fn hasher(&self) -> MetadataHasher<'_>
Obtain a unique hash representing this metadata or specific parts of it.
Trait Implementations§
source§impl Decode for Metadata
impl Decode for Metadata
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)
Convert self to a slice and append it to the destination.
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
Convert self to a slice and then invoke the given closure with it.
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
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
§type Error = TryFromError
type Error = TryFromError
The type returned in the event of a conversion error.
source§impl TryFrom<RuntimeMetadataV14> for Metadata
impl TryFrom<RuntimeMetadataV14> for Metadata
§type Error = TryFromError
type Error = TryFromError
The type returned in the event of a conversion error.
source§impl TryFrom<RuntimeMetadataV15> for Metadata
impl TryFrom<RuntimeMetadataV15> for Metadata
§type Error = TryFromError
type Error = TryFromError
The type returned in the event of a conversion error.
source§fn try_from(m: RuntimeMetadataV15) -> Result<Self, TryFromError>
fn try_from(m: RuntimeMetadataV15) -> Result<Self, TryFromError>
Performs the conversion.
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more