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§
Sourcefn current_state_root(&self) -> Result<<N as Network>::StateRoot, Error>
fn current_state_root(&self) -> Result<<N as Network>::StateRoot, Error>
Returns the current state root.
Sourcefn 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 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.
Sourcefn get_state_path_for_commitment(
&self,
commitment: &Field<N>,
) -> Result<StatePath<N>, Error>
fn get_state_path_for_commitment( &self, commitment: &Field<N>, ) -> Result<StatePath<N>, Error>
Returns a state path for the given commitment.
Sourcefn 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_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.
Sourcefn get_state_paths_for_commitments(
&self,
commitments: &[Field<N>],
) -> Result<Vec<StatePath<N>>, Error>
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.
Sourcefn 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 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.
Sourcefn current_block_height(&self) -> Result<u32, Error>
fn current_block_height(&self) -> Result<u32, Error>
Returns the current block height
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".