Struct subxt_codegen::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 outer_enums(&self) -> OuterEnumsMetadata
pub fn outer_enums(&self) -> OuterEnumsMetadata
Return details about the outer enums.
sourcepub fn pallets(&self) -> impl ExactSizeIterator
pub fn pallets(&self) -> impl ExactSizeIterator
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
pub fn runtime_api_traits(&self) -> impl ExactSizeIterator
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.
Trait Implementations§
source§impl Decode for Metadata
impl Decode for Metadata
source§fn decode<I>(input: &mut I) -> Result<Metadata, Error>where
I: Input,
fn decode<I>(input: &mut I) -> Result<Metadata, Error>where
I: Input,
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>(&self, dest: &mut T)
fn encode_to<T>(&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 TryFrom<RuntimeMetadataPrefixed> for Metadata
impl TryFrom<RuntimeMetadataPrefixed> for Metadata
§type Error = TryFromError
type Error = TryFromError
source§fn try_from(
value: RuntimeMetadataPrefixed
) -> Result<Metadata, <Metadata as TryFrom<RuntimeMetadataPrefixed>>::Error>
fn try_from( value: RuntimeMetadataPrefixed ) -> Result<Metadata, <Metadata as TryFrom<RuntimeMetadataPrefixed>>::Error>
source§impl TryFrom<RuntimeMetadataV14> for Metadata
impl TryFrom<RuntimeMetadataV14> for Metadata
§type Error = TryFromError
type Error = TryFromError
source§fn try_from(
value: RuntimeMetadataV14
) -> Result<Metadata, <Metadata as TryFrom<RuntimeMetadataV14>>::Error>
fn try_from( value: RuntimeMetadataV14 ) -> Result<Metadata, <Metadata as TryFrom<RuntimeMetadataV14>>::Error>
source§impl TryFrom<RuntimeMetadataV15> for Metadata
impl TryFrom<RuntimeMetadataV15> for Metadata
§type Error = TryFromError
type Error = TryFromError
source§fn try_from(m: RuntimeMetadataV15) -> Result<Metadata, TryFromError>
fn try_from(m: RuntimeMetadataV15) -> Result<Metadata, 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> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.