Struct 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

Source

pub fn types(&self) -> &PortableRegistry

Access the underlying type registry.

Source

pub fn types_mut(&mut self) -> &mut PortableRegistry

Mutable access to the underlying type registry.

Source

pub fn dispatch_error_ty(&self) -> Option<u32>

The type ID of the DispatchError type, if it exists.

Source

pub fn extrinsic(&self) -> &ExtrinsicMetadata

Return details about the extrinsic format.

Source

pub fn outer_enums(&self) -> OuterEnumsMetadata

Return details about the outer enums.

Source

pub fn pallets(&self) -> impl ExactSizeIterator<Item = PalletMetadata<'_>>

An iterator over all of the available pallets.

Source

pub fn pallet_by_index(&self, variant_index: u8) -> Option<PalletMetadata<'_>>

Access a pallet given its encoded variant index.

Source

pub fn pallet_by_name(&self, pallet_name: &str) -> Option<PalletMetadata<'_>>

Access a pallet given its name.

Source

pub fn runtime_api_traits( &self, ) -> impl ExactSizeIterator<Item = RuntimeApiMetadata<'_>>

An iterator over all of the runtime APIs.

Source

pub fn runtime_api_trait_by_name( &self, name: &str, ) -> Option<RuntimeApiMetadata<'_>>

Access a runtime API trait given its name.

Source

pub fn view_function_by_query_id( &self, query_id: &[u8; 32], ) -> Option<ViewFunctionMetadata<'_>>

Access a view function given its query ID, if any.

Source

pub fn custom(&self) -> CustomMetadata<'_>

Returns custom user defined types

Source

pub fn hasher(&self) -> MetadataHasher<'_>

Obtain a unique hash representing this metadata or specific parts of it.

Source

pub fn type_hash(&self, id: u32) -> Option<[u8; 32]>

Get type hash for a type in the registry

Trait Implementations§

Source§

impl Clone for Metadata

Source§

fn clone(&self) -> Metadata

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Metadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Decode for Metadata

Source§

fn decode<I: Input>(input: &mut I) -> Result<Self, Error>

Attempt to deserialise the value from input.
Source§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Source§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
Source§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

impl ExtrinsicTypeInfo for Metadata

Source§

type TypeId = u32

The type of type IDs that we are using to obtain type information.
Source§

fn get_call_info( &self, pallet_index: u8, call_index: u8, ) -> Result<ExtrinsicCallInfo<'_, Self::TypeId>, ExtrinsicInfoError<'_>>

Get the information about the call data of a given extrinsic.
Source§

fn get_signature_info( &self, ) -> Result<ExtrinsicSignatureInfo<Self::TypeId>, ExtrinsicInfoError<'_>>

Get the information needed to decode the extrinsic signature bytes.
Source§

fn get_extension_info( &self, extension_version: Option<u8>, ) -> Result<ExtrinsicExtensionInfo<'_, Self::TypeId>, ExtrinsicInfoError<'_>>

Get the information needed to decode the transaction extensions.
Source§

impl TryFrom<RuntimeMetadataPrefixed> for Metadata

Source§

type Error = TryFromError

The type returned in the event of a conversion error.
Source§

fn try_from(value: RuntimeMetadataPrefixed) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<RuntimeMetadataV14> for Metadata

Source§

type Error = TryFromError

The type returned in the event of a conversion error.
Source§

fn try_from(m: RuntimeMetadataV14) -> Result<Self, TryFromError>

Performs the conversion.
Source§

impl TryFrom<RuntimeMetadataV15> for Metadata

Source§

type Error = TryFromError

The type returned in the event of a conversion error.
Source§

fn try_from(m: RuntimeMetadataV15) -> Result<Self, TryFromError>

Performs the conversion.
Source§

impl TryFrom<RuntimeMetadataV16> for Metadata

Source§

type Error = TryFromError

The type returned in the event of a conversion error.
Source§

fn try_from(m: RuntimeMetadataV16) -> Result<Self, TryFromError>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DecodeAll for T
where T: Decode,

Source§

fn decode_all(input: &mut &[u8]) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
Source§

impl<T> DecodeLimit for T
where T: Decode,

Source§

fn decode_all_with_depth_limit( limit: u32, input: &mut &[u8], ) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
Source§

fn decode_with_depth_limit<I>(limit: u32, input: &mut I) -> Result<T, Error>
where I: Input,

Decode Self with the given maximum recursion depth and advance input by the number of bytes consumed. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> JsonSchemaMaybe for T