pub struct QueryApi<'api> { /* private fields */ }
Implementations§
source§impl<'api> QueryApi<'api>
impl<'api> QueryApi<'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<u64>>
pub async fn block_weight(&self) -> Result<PerDispatchClass<u64>>
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<Event>>>
pub async fn events(&self) -> Result<Vec<EventRecord<Event>>>
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§
Auto Trait Implementations§
impl<'api> !RefUnwindSafe for QueryApi<'api>
impl<'api> Send for QueryApi<'api>
impl<'api> Sync for QueryApi<'api>
impl<'api> Unpin for QueryApi<'api>
impl<'api> !UnwindSafe for QueryApi<'api>
Blanket Implementations§
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.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> 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 more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.