pub struct SystemQueryApi<'api> { /* private fields */ }
Implementations§
Source§impl<'api> SystemQueryApi<'api>
impl<'api> SystemQueryApi<'api>
Sourcepub async fn account(
&self,
key_0: AccountId,
) -> Result<AccountInfo<u32, AccountData>>
pub async fn account( &self, key_0: AccountId, ) -> Result<AccountInfo<u32, AccountData>>
The full account information for a particular account ID.
Sourcepub async fn extrinsic_count(&self) -> Result<Option<u32>>
pub async fn extrinsic_count(&self) -> Result<Option<u32>>
Total extrinsics count for the current block.
Sourcepub async fn block_weight(&self) -> Result<PerDispatchClass<Weight>>
pub async fn block_weight(&self) -> Result<PerDispatchClass<Weight>>
The current weight for the block.
Sourcepub async fn all_extrinsics_len(&self) -> Result<Option<u32>>
pub async fn all_extrinsics_len(&self) -> Result<Option<u32>>
Total length (in bytes) for all extrinsics put together, for the current block.
Sourcepub async fn block_hash(&self, key_0: u32) -> Result<H256>
pub async fn block_hash(&self, key_0: u32) -> Result<H256>
Map of block numbers to block hashes.
Sourcepub async fn extrinsic_data(&self, key_0: u32) -> Result<Vec<u8>>
pub async fn extrinsic_data(&self, key_0: u32) -> Result<Vec<u8>>
Extrinsics data for the current block (maps an extrinsic’s index to its data).
Sourcepub async fn number(&self) -> Result<u32>
pub async fn number(&self) -> Result<u32>
The current block number being processed. Set by execute_block
.
Sourcepub async fn parent_hash(&self) -> Result<H256>
pub async fn parent_hash(&self) -> Result<H256>
Hash of the previous block.
Sourcepub async fn digest(&self) -> Result<Digest>
pub async fn digest(&self) -> Result<Digest>
Digest of the current block, also part of the block header.
Sourcepub async fn events(&self) -> Result<Vec<EventRecord<RuntimeEvent>>>
pub async fn events(&self) -> Result<Vec<EventRecord<RuntimeEvent>>>
Events deposited for the current block.
NOTE: The item is unbound and should therefore never be read on chain. It could otherwise inflate the PoV size of a block.
Events have a large in-memory size. Box the events to not go out-of-memory just in case someone still reads them from within the runtime.
Sourcepub async fn event_count(&self) -> Result<u32>
pub async fn event_count(&self) -> Result<u32>
The number of events in the Events<T>
list.
Sourcepub async fn event_topics(&self, key_0: H256) -> Result<Vec<(u32, u32)>>
pub async fn event_topics(&self, key_0: H256) -> Result<Vec<(u32, u32)>>
Mapping between a topic (represented by T::Hash) and a vector of indexes
of events in the <Events<T>>
list.
All topic vectors have deterministic storage locations depending on the topic. This allows light-clients to leverage the changes trie storage tracking mechanism and in case of changes fetch the list of events of interest.
The value has the type (T::BlockNumber, EventIndex)
because if we used only just
the EventIndex
then in case if the topic has the same contents on the next block
no notification will be triggered thus the event might be lost.
Sourcepub async fn last_runtime_upgrade(
&self,
) -> Result<Option<LastRuntimeUpgradeInfo>>
pub async fn last_runtime_upgrade( &self, ) -> Result<Option<LastRuntimeUpgradeInfo>>
Stores the spec_version
and spec_name
of when the last runtime upgrade happened.
Sourcepub async fn upgraded_to_u32_ref_count(&self) -> Result<bool>
pub async fn upgraded_to_u32_ref_count(&self) -> Result<bool>
True if we have upgraded so that type RefCount
is u32
. False (default) if not.
Sourcepub async fn upgraded_to_triple_ref_count(&self) -> Result<bool>
pub async fn upgraded_to_triple_ref_count(&self) -> Result<bool>
True if we have upgraded so that AccountInfo contains three types of RefCount
. False
(default) if not.
Sourcepub async fn execution_phase(&self) -> Result<Option<Phase>>
pub async fn execution_phase(&self) -> Result<Option<Phase>>
The execution phase of the block.
Trait Implementations§
Source§impl<'api> Clone for SystemQueryApi<'api>
impl<'api> Clone for SystemQueryApi<'api>
Source§fn clone(&self) -> SystemQueryApi<'api>
fn clone(&self) -> SystemQueryApi<'api>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'api> Freeze for SystemQueryApi<'api>
impl<'api> !RefUnwindSafe for SystemQueryApi<'api>
impl<'api> Send for SystemQueryApi<'api>
impl<'api> Sync for SystemQueryApi<'api>
impl<'api> Unpin for SystemQueryApi<'api>
impl<'api> !UnwindSafe for SystemQueryApi<'api>
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> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read moreSource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.