Skip to main content

QueryTrait

Trait QueryTrait 

Source
pub trait QueryTrait<N>
where N: Network,
{ // Required methods fn current_state_root(&self) -> Result<<N as Network>::StateRoot, Error>; fn current_state_root_async<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<<N as Network>::StateRoot, Error>> + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn get_state_path_for_commitment( &self, commitment: &Field<N>, ) -> Result<StatePath<N>, Error>; fn get_state_path_for_commitment_async<'life0, 'life1, 'async_trait>( &'life0 self, commitment: &'life1 Field<N>, ) -> Pin<Box<dyn Future<Output = Result<StatePath<N>, Error>> + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_state_paths_for_commitments( &self, commitments: &[Field<N>], ) -> Result<Vec<StatePath<N>>, Error>; fn get_state_paths_for_commitments_async<'life0, 'life1, 'async_trait>( &'life0 self, commitments: &'life1 [Field<N>], ) -> Pin<Box<dyn Future<Output = Result<Vec<StatePath<N>>, Error>> + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn current_block_height(&self) -> Result<u32, Error>; fn current_block_height_async<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; }
Expand description

Custom query trait for state root fetching.

Required Methods§

Source

fn current_state_root(&self) -> Result<<N as Network>::StateRoot, Error>

Returns the current state root.

Source

fn current_state_root_async<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<<N as Network>::StateRoot, Error>> + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the current state root.

Source

fn get_state_path_for_commitment( &self, commitment: &Field<N>, ) -> Result<StatePath<N>, Error>

Returns a state path for the given commitment.

Source

fn get_state_path_for_commitment_async<'life0, 'life1, 'async_trait>( &'life0 self, commitment: &'life1 Field<N>, ) -> Pin<Box<dyn Future<Output = Result<StatePath<N>, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Returns a state path for the given commitment.

Source

fn get_state_paths_for_commitments( &self, commitments: &[Field<N>], ) -> Result<Vec<StatePath<N>>, Error>

Returns a list of state paths for the given list of commitments.

Source

fn get_state_paths_for_commitments_async<'life0, 'life1, 'async_trait>( &'life0 self, commitments: &'life1 [Field<N>], ) -> Pin<Box<dyn Future<Output = Result<Vec<StatePath<N>>, Error>> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Returns a list of state paths for the given list of commitments.

Source

fn current_block_height(&self) -> Result<u32, Error>

Returns the current block height

Source

fn current_block_height_async<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the current block height

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl QueryTrait<TestnetV0> for ProvableQuery

Source§

impl<N, B> QueryTrait<N> for Query<N, B>
where N: Network, B: BlockStorage<N>,

Source§

impl<N: Network> QueryTrait<N> for FixedStateRootQuery<N>

Source§

impl<N> QueryTrait<N> for RestQuery<N>
where N: Network,

Source§

impl<N> QueryTrait<N> for StaticQuery<N>
where N: Network,