Struct subxt_metadata::PalletMetadata

source ·
pub struct PalletMetadata<'a> { /* private fields */ }
Expand description

Metadata for a specific pallet.

Implementations§

source§

impl<'a> PalletMetadata<'a>

source

pub fn name(&self) -> &'a str

The pallet name.

source

pub fn index(&self) -> u8

The pallet index.

source

pub fn docs(&self) -> &'a [String]

The pallet docs.

source

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

Type ID for the pallet’s Call type, if it exists.

source

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

Type ID for the pallet’s Event type, if it exists.

source

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

Type ID for the pallet’s Error type, if it exists.

source

pub fn storage(&self) -> Option<&'a StorageMetadata>

Return metadata about the pallet’s storage entries.

source

pub fn event_variants(&self) -> Option<&'a [Variant<PortableForm>]>

Return all of the event variants, if an event type exists.

source

pub fn event_variant_by_index( &self, variant_index: u8 ) -> Option<&'a Variant<PortableForm>>

Return an event variant given it’s encoded variant index.

source

pub fn call_variants(&self) -> Option<&'a [Variant<PortableForm>]>

Return all of the call variants, if a call type exists.

source

pub fn call_variant_by_index( &self, variant_index: u8 ) -> Option<&'a Variant<PortableForm>>

Return a call variant given it’s encoded variant index.

source

pub fn call_variant_by_name( &self, call_name: &str ) -> Option<&'a Variant<PortableForm>>

Return a call variant given it’s name.

source

pub fn error_variants(&self) -> Option<&'a [Variant<PortableForm>]>

Return all of the error variants, if an error type exists.

source

pub fn error_variant_by_index( &self, variant_index: u8 ) -> Option<&'a Variant<PortableForm>>

Return an error variant given it’s encoded variant index.

source

pub fn constant_by_name(&self, name: &str) -> Option<&'a ConstantMetadata>

Return constant details given the constant name.

source

pub fn constants(&self) -> impl ExactSizeIterator<Item = &'a ConstantMetadata>

An iterator over the constants in this pallet.

source

pub fn storage_hash(&self, entry_name: &str) -> Option<[u8; 32]>

Return a hash for the storage entry, or None if it was not found.

source

pub fn constant_hash(&self, constant_name: &str) -> Option<[u8; 32]>

Return a hash for the constant, or None if it was not found.

source

pub fn call_hash(&self, call_name: &str) -> Option<[u8; 32]>

Return a hash for the call, or None if it was not found.

source

pub fn hash(&self) -> [u8; 32]

Return a hash for the entire pallet.

Trait Implementations§

source§

impl<'a> Clone for PalletMetadata<'a>

source§

fn clone(&self) -> PalletMetadata<'a>

Returns a copy 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<'a> Debug for PalletMetadata<'a>

source§

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

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

impl<'a> Copy for PalletMetadata<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for PalletMetadata<'a>

§

impl<'a> RefUnwindSafe for PalletMetadata<'a>

§

impl<'a> Send for PalletMetadata<'a>

§

impl<'a> Sync for PalletMetadata<'a>

§

impl<'a> Unpin for PalletMetadata<'a>

§

impl<'a> UnwindSafe for PalletMetadata<'a>

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> 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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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